Git Push 避免输入用户名和密码方法
1 創(chuàng)建文件存儲GIT用戶名和密碼
在%HOME%目錄中,一般為C:\users\Administrator,也可以是你自己創(chuàng)建的系統(tǒng)用戶名目錄,反正都在C:\users\中。文件名為.git-credentials,由于在Window中不允許直接創(chuàng)建以"."開頭的文件,所以需要借助git bash進行,打開git bash客戶端,進行%HOME%目錄,然后用touch創(chuàng)建文件 .git-credentials, 用vim編輯此文件,輸入內(nèi)容格式:
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
2 添加Git Config 內(nèi)容
進入git bash終端, 輸入如下命令:
?
git config --global credential.helper store
執(zhí)行完后查看%HOME%目錄下的.gitconfig文件,會多了一項:
[credential]helper = store重新開啟git bash會發(fā)現(xiàn)git push時不用再輸入用戶名和密碼
轉(zhuǎn)載于:https://www.cnblogs.com/liyan-blogs/p/5475253.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎總結(jié)
以上是生活随笔為你收集整理的Git Push 避免输入用户名和密码方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python列表遍历 空列表_Pytho
- 下一篇: 今年Java面试必问的这些技术面,赶快收