每次提交**都要輸入使用者名稱密碼,十分麻煩,教大家怎麼讓git記住密碼。
永久記住密碼
會在使用者主目錄的git config --global credential.helper store
.gitconfig
檔案中生成下面的配置。
如果沒有[credential]
helper =store
--global
,則在當前專案下的.git/config
檔案中新增。
當然,你也可以直接複製上面生成的配置到配置檔案中。
臨時記住密碼
預設記住15分鐘:
下面是自定義配置記住1小時:git config –global credential.helper cache
可以從乙個已有的ssh key來記住密碼,會在使用者主目錄下的git config credential.helper 『cache –timeout=3600』
known_hosts
生成配置。
把ssh key新增到ssh-agent
如新增過程:$ eval $(ssh-agent -s)
$ ssh-add ~/.ssh/id_rsa
這個對當前會話有效,關閉視窗或者重啟電腦又要重新設定,這個很蛋疼$ eval $(ssh-agent -s)
agent pid 54188
$ ssh-add ~/.ssh/id_rsa
enter passphrase for /c/users/administrator/.ssh/id_rsa:
identity added: /c/users/administrator/.ssh/id_rsa (/c/users/administrator/.ssh/id_rsa)
git記住密碼
是不是受夠了http方式每次輸入使用者名稱和密碼?好吧下面說說解決這個問題的方法 方法一 git bash輸入命令 git config global credential.helper store ok,回車,這個時候已經記住了密碼,就是這樣,沒了。可能下一次還要密碼的情況,沒關係,在輸入一次,因...
git 記住密碼
git bash 進入.git資料夾 git config global credential.helper storegit config credential.helper store global 引數為全域性設定,可不加 設定後,第一次拉取或推送需要密碼,之後就不要了 重新裝git後 沒輸密...
git記住賬號密碼
涉及到記住密碼的方式,只適用於http s 方式,記住密碼的幾種方式 https 方式每次都要輸入密碼,按照如下設定即可輸入一次就不用再手輸入密碼的困擾而且又享受 https 帶來的極速 按照以下設定記住密碼十五分鐘 git config global credential.helper cache...