如果你的git每次push操作都要重複輸入密碼,檢查其它的設定也沒有問題,那原因很大可能是你在生成金鑰時設定了密碼。通常金鑰是這樣生成的:
開啟命令列終端輸入 ssh-keygen -t rsa -c "[email protected]" ( 你的郵箱),連續點選 enter 鍵即可,中間提示輸入密碼時不要輸入。
ssh-keygen -t rsa -b 4096 -c "[email protected]"# creates a new ssh key, using the provided email as a label
# generating public/private rsa key pair.
enter passphrase (empty for no passphrase): //此處點選 enter 鍵即可,也可以填寫密碼,但填寫密碼後每次使用 ssh 方式推送**時都會要求輸入密碼,如果不是絕對重要機密,無需設定密碼。