git push 不用輸入使用者名稱和密碼

2022-09-19 06:36:08 字數 412 閱讀 2789

在終端中輸入命令

git config  credential.helper store
開啟.git資料夾的.config檔案,回發現多了兩行

[credential] 

helper=store

git push 到遠端倉庫,輸入使用者名稱和密碼,注意要輸入正確的

再次執行git push 就不用輸入使用者名稱和密碼了

在使用者主目錄資料夾多了乙個檔案git-credentials,這個就是用來儲存使用者名稱和密碼的

也可以在第2步時指定此檔案檔名和儲存位置

--file ~/git-credentials

~代表當前目錄

配置git push不用每次輸入使用者名稱和密碼

1.使用ssh協議ssh keygen t rsa c xx xx.com generating public private rsa key pair.三次回車即可生成 ssh keycat ssh id rsa.pub ssh rsa aaaab3nzac1yc2eaaaadaqabaaabaq...

git push 避免重複輸入使用者名稱和密碼

touch git credentials vim git credentials 新增git config 內容 進入git bash終端,輸入如下命令 git config global credential.helper store 執行完後檢視 home 目錄下的.gitconfig檔案,會...

git push 提示需要輸入使用者名稱和密碼

一 問題描述 每次 git push 的時候都要提示輸入使用者名稱和密碼 在 家目錄 下建立.git credentials檔案,並填充以下內容 username 是登入名,password 是密碼,github.com 是 倉庫的位址 在終端執行git config global credenti...