How to make git not prompt for passphrase for ssh key?

You can run this in git bash, Windows WLS or bash on real GNU/Linux.

eval `ssh-agent -s`
ssh-add ~/.ssh/*_rsa

it will ask for pass phrase in the second command, and that's it. Each additional action you will need to do (which once required pass phrase) won't ask you for the pass phrase (see an example in the screen shot below):

adding pass phrase in git bash on Windows


A slightly better and permanent solution is to auto launch the ssh-agent when opening the git bash on windows. You can copy/paste the below in your .profile or .bashrc. I prefer to put it on the .profile

env=~/.ssh/agent.env

agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }

agent_start () {
    (umask 077; ssh-agent >| "$env")
    . "$env" >| /dev/null ; }

agent_load_env

# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)

if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
    agent_start
    ssh-add
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
    ssh-add
fi

unset env

This solution was taken from this github help article


Im not sure if I want to recommend it, but when you create the Key and asked to set password, just hit enter and skip the password.

Have a look at this link for how to use ssh-keygen: https://help.github.com/articles/working-with-ssh-key-passphrases/

Perhaps ssh-agent can help you somehow. But not sure without knowing your current system.