參考鏈接:http://www.linuxdiyf.com/linux/18389.html
鏈接2:https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%87%AD%E8%AF%81%E5%AD%98%E5%82%A8#_credential_caching
我選擇的是明文存放在磁盤中,不過期的
1.創建並且寫入.git-credentials文件,vim編輯他,寫入下面一條
2.比如用戶名為tom,密碼為tompassword,就這樣寫
https://tom:tompassword@github.com
3.保存后在終端下執行 git config --global credential.helper store
這樣就可以了