解決git命令行每次都要輸入賬號密碼


Windows 上設置避免每次 git push 都需要賬號密碼

在 C:\Users\your name\ 目錄下找到到 .gitconfig 這個文件,使用編輯器打開

[user]
    name = ****
    email = ********.com

文件中增加 [credential]配置

[credential]
    helper = store

配置完成保存退出,在項目文件夾打開git bash,使用git pull再輸入一次賬號密碼。最后一次使用git pull

$ git pull
Already up to date.

ok.

linux 上設置避免每次 git push 都需要賬號密碼

cd /進入根目錄,執行以下命令

git config --global credential.helper store

上述命令目的與windows環境中直接編輯.gitconfig目的相同。

進入項目目錄,執行git pull,按windows環境操作完成賬號密碼的錄入即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM