1. 程式人生 > >GIT無法記住賬戶密碼問題

GIT無法記住賬戶密碼問題

git賬戶問題 git

最近, 在公司ios代碼編譯的過程中,執行pod update的時候,從git裏面拉取代碼時候,總是報錯:fatal:could not read Username for 'https://github.com':No such file or directory ,使用協議是https傳輸協議。

根據提示判斷就是沒有記住git的賬戶和密碼引起的問題。

首先進行了 賬戶的全局設置:

git config --global user.name "xxxx"

git config --global user.email "[email protected]"


然後執行,發現問題還是存在,然後搜索一下記住賬戶密碼的全局配置:

git config --global credential.helper store

然後執行構建,發現問題同樣存在,後來在coding 官方上面找到一篇說明文檔,試了有效。

有兩種方法:

  • 使用 SSH 方式進行推送,您需要配置 SSH 公鑰後進行操作,詳情請閱讀 SSH 公鑰配置文檔

  • 對於 Https 協議: 首先在全局配置保存你的密碼, ~/.git-credentials (沒有就創建)內添加https://{username}:{passwd}@git.coding.net然後執行配置 Git 命令存儲認證命令:

  • $git config

    --global credential.helper store

執行後在 ~/.gitconfig 文件會多出下面配置項:

credential.helper = store


希望能對遇到同樣的問題的小夥伴 有幫助!!!當然可以直接使用ssh的方式。



GIT無法記住賬戶密碼問題