title: git push using ssh-agent in bash but not gui
body: <p>Using git for windows (git-scm.com) and a script, i can get Bash to stop asking for the passphrase but i can not seem to remove the passphrase prompt from git GUI.</p>
  
  <p>The url to the remote is using the ssh link (see below), so im pretty sure this is not the problem. But i am not an expert in git nor SSH..</p>
  
  <pre><code>git@gitlab.com:repo
  </code></pre>
  
  <p>The SSH keys (ED25519) have been created with a passphrase provided and the public key was added to the hosting account. The SSH keys are stored in the typical location <code>C:\Users\&lt;user&gt;\.ssh\id_ed25519</code>. When clicking <code>Help-&gt;Show SSH Key</code> in the GUI, it shows my ssh key that is being used. The ssh-agent is running in the background and the ssh key has been added to the ssh-agent via the setup below.</p>
  
  <p>Setting up the ssh-agent i had used the code provided <a href="https://help.github.com/en/articles/working-with-ssh-key-passphrases#auto-launching-ssh-agent-on-git-for-windows" rel="nofollow noreferrer">here</a> (copied and pasted below for reference) to create the <code>.bashrc</code> file under the <code>C:\Users\&lt;user&gt;</code> path. Everything seems to be running as expected under the bash prompt but not the Git GUI.</p>
  
  <pre><code>env=~/.ssh/agent.env
  
  agent_load_env () { test -f "$env" &amp;&amp; . "$env" &gt;| /dev/null ; }
  
  agent_start () {
      (umask 077; ssh-agent &gt;| "$env")
      . "$env" &gt;| /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 &gt;| /dev/null 2&gt;&amp;1; echo $?)
  
  if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
      agent_start
      ssh-add
  elif [ "$SSH_AUTH_SOCK" ] &amp;&amp; [ $agent_run_state = 1 ]; then
      ssh-add
  fi
  
  unset env
  </code></pre>
  
  <p>To me, it seems like the Git GUI is not using the ssh-agent when performing an push, fetch, or any other related remote feature. Is there a step i missed in setting up the ssh-agent, <code>.bashrc</code> script, and or the GUI to finish removing the passphrase prompt? or is there something else going on?</p>
  
  <p>Any and all help is much appreciated, Thanks in advance</p>