How can I perform a `git pull` without re-entering my SSH password?

前端 未结 5 1088
挽巷
挽巷 2021-01-30 03:48

Is it possible to configure git/ssh so I don\'t have to enter my passphrase every time I want to perform a git pull? Note that the repo is a private

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 04:11

    I dont know why hasnt anyone reported this yet. But the simplest approach would be to simply add a single line AddKeysToAgent yes on the top of the .ssh/config file. Ofcourse ssh-agent must be running beforehand. If its not running ( check by the command ssh-agent on the terminal ) , then simply run it eval $(ssh-agent)

    I can confirm that this works, because in my project with lots of submodules and for each submodule being cloned, I had to type in my ssh passphrase. After the above trick, I dont need to do it anymore.

    The source of the solution is https://askubuntu.com/questions/362280/enter-ssh-passphrase-once/853578#853578

提交回复
热议问题