来源:https://stackoverflow.com/questions/35942754/how-can-i-save-username-and-password-in-git
-
先执行命令
git config --global credential.helper store
设置 git 遇到密码是进行保存 -
执行
git pull
、git clone
等命令,此时如果需要密码,那么 git 会提示输入账号/密码,输入完成后,账号和密码就会被存储在文件~/.git-credentials
中。存储格式是明文的。