在使用git的時候,如果你是用ssh協議的話,必須要提交你的公鑰匙給git,
ssh-keygen -C '[email protected]' -t rsa 密碼直接回車,然後家目錄中.ssh 中id_rsa.pub打開復制KEY,到git官網進行填寫
ssh -T [email protected] 驗證祕鑰是否成功
如果你不是用ssh協議,用的是https協議
linux下
在~/下, touch創建文件 .git-credentials, 用vim編輯此文件,輸入內容格式:
touch .git-credentials
vim .git-credentials
https://{username}:{password}@github.com
2. 在終端下執行 git config --global credential.helper store
3. 可以看到~/.gitconfig文件,會多了一項:
[credential]
helper = store
設置完成