title: Connect to Git repository with SSH using Visual Studio 2017
body: <p>I'm trying to connect to a Git repository (on Bitbucket) with SSH from Visual Studio 2017 (which, as far as I know, supports SSH for Git). I have everything set up, the repository cloned on my computer, and I can commit, but if I try to do something like fetching it fails with the following message (from Visual Studio's "Output" window):</p>
  
  <pre><code>Error encountered while fetching: Git failed with a fatal error.
  fatal: Could not read from remote repository.
  </code></pre>
  
  <p>Trying it from the command prompt, I get these slightly more informative messages:</p>
  
  <pre><code>Permission denied (publickey).
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>From Git Bash I have tried opening the SSH agent, adding my private key, and fetching, and it seems to work (or at least I don't get any messages, unlike when the agent is not started or the key not added):</p>
  
  <pre><code>eval `ssh-agent`
  ssh-add ~/.ssh/xxxx
  git fetch
  </code></pre>
  
  <p>But Visual Studio is still unable to connect. I have also tried to do the same from the Windows command prompt:</p>
  
  <pre><code>ssh-agent
  set SSH_AUTH_SOCK=/tmp/ssh-SIAryCa61iz9/agent.11128
  set SSH_AGENT_PID=9804
  ssh-add xxxx
  git fetch
  </code></pre>
  
  <p>But I still get the same error.</p>
  
  <p>I already added the public key to Bitbucket, and <code>ssh -T git@bitbucket.org</code> does output "logged in as xxxx". Also, I can connect correctly using SourceTree and adding the private key to Pageant (the key I use for <code>ssh-add</code> has the required OpenSSH format, I created it from the .ppk one).</p>