gitbash https git credentials 小烏龜 TortoiseGit 配置備忘
小烏龜 TortoiseGit
git credentials Docs: https://git-scm.com/docs/gitcredentials
參考官方創建了 .git-credentials 文件,怎麼都不生效。遇見好幾種錯誤:
- fatal: unable to access 'https://gitlab.example.org/bi-source/hiveUDF.git/': Couldn't resolve host 'gitlab.example.org'
- fatal: unable to access 'https://gitlab.example.org/bi-source/hiveUDF.git/': The requested URL returned error: 500
最後啊最好,還是用小烏龜才終於解決問題。
- 小烏龜官網
- for 64-bit Windows:TortoiseGit-2.5.0.0-64bit.msi
- for 32-bit Windows:TortoiseGit-2.5.0.0-32bit.msi
小烏龜配置
安裝就不多說了吧,按照提示一步步點就好了。
關鍵配置
第1步:找到配置
第2步:配置htps的證書:
第3步:配置git賬戶信息
訪問https驗證
小烏龜界面驗證
先用小烏龜的界面pull代碼,系統會彈出一個用戶名密碼的輸入框,輸入自己在https://gitlab.example.org上的用戶名密碼。
pull代碼成功。
gitbash 更新代碼
git pull origin master
成功!
小烏龜創建的配置文件
上面設置小烏龜以後,打開gitbash,在用戶目錄下
cd ~
cat .gitconfig
其內容如下:
[user]
name = bibi
[user]
email = bibi@example.com
[credential "https://gitlab.example.org"]
helper = manager
username = 比比
useHttpPath = true
跟 【git credentials 官方文檔】文檔的配置有較大差異。但是卻是有效的。花了不少時間幫同事配置這個,特寫此文檔備忘。