title: Getting ssh-agent to work with git run from windows command shell
body: <p>I have msysgit installed, with OpenSSH. I am connecting to a gitosis repo. From the git bash, I have created a <code>.profile</code> file that runs ssh-agent (if not already running) each time git bash is opened, <a href="http://www.cygwin.com/ml/cygwin/2001-06/msg00537.html" rel="noreferrer">using this script</a></p>
  
  <pre class="lang-sh prettyprint-override"><code>SSH_ENV=$HOME/.ssh/environment
  
  function start_agent {
       echo "Initialising new SSH agent..."
       /usr/bin/ssh-agent | sed 's/^echo/#echo/' &gt; ${SSH_ENV}
       echo succeeded
       chmod 600 ${SSH_ENV}
       . ${SSH_ENV} &gt; /dev/null
       /usr/bin/ssh-add;
  }
  
  # Source SSH settings, if applicable
  
  if [ -f "${SSH_ENV}" ]; then
       . ${SSH_ENV} &gt; /dev/null
       #ps ${SSH_AGENT_PID} doesn't work under cywgin
       ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ &gt; /dev/null || {
           start_agent;
       }
  else
       start_agent;
  fi
  </code></pre>
  
  <p>I am also using git extensions, which runs the git command from the Windows command prompt, not git bash. So, ssh doesn't see the ssh-agent that is running. Is it possible to fix this?</p>