1. 創建文件存儲GIT用戶名和密碼
在home
目錄中,添加.git-credentials:
cd ~
vim .git-credentials
https://{username}:{password}@github.com
2. 添加Git Config 內容
輸入如下命令:
git config --global credential.helper store
執行完后查看.gitconfig文件,會多了一項:
[credential]
helper = store
git push時就不用再輸入用戶名和密碼