2018/06/27

[Git] 在 Windows 使用指令更新 Git 版本

指令就一行,更新很簡單,也不用再去手動找下載點囉!

git update-git-for-windows

2018/06/23

[PowerShell] 安裝 posh-git 模組至 PowerShell

介紹


posh-git 是整合 PowerShell 及 Git 的模組,它提供了整合資訊顯示在命令列中

設定


先開啟 PowerShell 執行安裝模組 (範圍設定為目前的使用者)

Install-Module posh-git -Scope CurrentUser

回答都輸入 Y (是)

匯入 posh-git 模組

Import-Module posh-git



如此一來即可在 PowerShell 看到 Git 的狀態



若要永久使用,就把它加到自己的 Profile 設定去

Add-PoshGitToProfile

以後開 PowerShell 就可以繼續享用 posh-git 囉!

2018/06/05

[VSCode] PHPUnit Snippets 擴充套件釋出


來囉~ 來囉~ Visual Studio Code 的擴充套件 PHPUnit Snippets 釋出囉!



套件介紹: PHPUnit Snippets

基本用法 - 看圖片說故事


1. 先確認文件是 PHP 的文件 (可按 Ctrl + K + M 切換)
2. 在 PHP 程式碼區段輸入 snippet, 圖例: assequ (自動會找到相近的名稱可使用,是不是超級聰明?可以少打好多字)

 

快來試試看吧~ PHPUnit Snippets 也別忘了給星星跟推薦唷!

2018/06/01

[Git] 解決 Remote 遇到自我憑證 SSL certification problem

在使用 Git 執行遠端的操作時,若是自我憑證架的服務,可能會遇到顯示以下的錯誤

fatal: unable to access 'https://localhost/winnie/test.git/': SSL certificate problem: self signed certificate


解決方法: (註: 若不想全面開放就不要下這個指令,安全性也會降低,不建議採用此項!)
git config --global http.sslVerify false

單次不驗證:
GIT_SSL_NO_VERIFY=true git clone https://localhost/winnie/test.git
或是
git -c http.sslVerify=false clone https://localhost/winnie/test.git

然後在該 repository 下, 再下一次指定, 即未來此 repository 不需再做驗證
git config http.sslVerify false


剛好用新機器再度遇到問題,還是筆記一下備用!


2021-03-20 更新:
在版本 2.31.0.windows.1 版本,若採用全域開放 http.sslVerify 為 false 時,會出現下圖警告:(SECURITY WARNING - TLS certificate verification has been disabled!)
Git 在 2.14.0 已提供可選擇切換 Secure Channel 與 OpenSSL,我們即可使用 Windows 憑證設定 (建議使用)
git config --global http.sslBackend schannel

參考連結: