參考鏈接:http://www.itdecent.cn/p/e946acf9f26e
前提,使用http方式clone
1、git config --global credential.helper store
2、git config --list
出現(xiàn)credential.helper=store說明操作成功。
后面操作的時(shí)候只需要輸入一次密碼之后,就可以免密碼操作了。
git賬號(hào)密碼輸入錯(cuò)誤后,再次操作會(huì)自動(dòng)使用上次輸入錯(cuò)誤的賬號(hào)密碼:
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'http://xxx.git/'
設(shè)置清空git保存的賬號(hào)密碼并每次操作時(shí)強(qiáng)制輸入賬號(hào)密碼,即git不自定保存賬號(hào)密碼
git config --system --unset credential.helper
設(shè)置git自動(dòng)保存輸入的賬號(hào)密碼
git config --global credential.helper store