解決git 每次使用都需要輸入賬號密碼 ( Windows和linux)


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

在 C:\Users\luojie\ 目錄下 能看到 [.gitconfig] 這個文件:

[user]  
    name = kn****  
    email = ************.com  
[credential]  
    helper = store

配置了credential之后就可以存儲賬號密碼,下次不用再輸入

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

  • 先cd到根目錄,執行git config --global credential.helper store命令
[root@iZ25mi9h7ayZ ~]# git config --global credential.helper store
  • 執行之后會在.gitconfig文件中多加紅色字體項
[user]
        name = 天明
        email = xxxx@xxxx.com
[credential]
        helper = store
  • 之后cd到項目目錄,執行git pull命令,會提示輸入賬號密碼。輸完這一次以后就不再需要,並且會在根目錄生成一個.git-credentials文件


免責聲明!

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



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