1.執行命令:
git config --global credential.helper store
這個時候~/.gitconfig文件中會多一行
[credential]
helper = store
2.再次執行git pull 輸入賬號密碼
此時你會看到/root/.git-credentials
中會多一行內容。里面的內容類似https://{username}:{password}@github.com
這種形式
或者是
[credential]
helper = store
[user]
email = XXXXX@qq.com
name = yourname
形式
3.以后git pull 就不用輸入密碼了