git fails to clone: The remote end hung up unexpectedly
<p>I'm using <a href="http://bitbucket.org" rel="nofollow">bitbucket</a> for my team project.
The problem only appeared after I deleted the local repository (because it wouldn't let me commit changes, but that's another story).
But when i cloned for the first time, it did work (I used the HTTP URL).</p>

<p>Currently, when I try to clone using the Visual Studio's team explorer GUI (team explorer tab: connect -> Local Git Repositories -> Clone, and entering the HTTP URL of the git repository, the following message appears:</p>

<blockquote>
  <p>Failed to clone the remote repository. See the Output window for more
  details.  </p>
</blockquote>

<p>The Output window says: </p>

<blockquote>
  <p>The underlying connection was closed: The connection was closed unexpectedly.</p>
</blockquote>

<hr>

<p>If I enter the SSH URL instead (using the same method again) it pops:</p>

<blockquote>
  <p>Invalid URI: The URI scheme is not valid.</p>
</blockquote>

<hr>

<p>If I use git bash and enter <code>git clone &lt;HTTP URL&gt;</code> it prints:</p>

<blockquote>
  <p>error: RPC failed; curl 52 Empty reply from server<br>
  fatal: The remote end hung up unexpectedly</p>
</blockquote>

<hr>

<p>If I use git bash and enter <code>git clone &lt;SSH URL&gt;</code> it prints:</p>

<blockquote>
  <p>Permission denied (publickey).<br>
  fatal: Could not read from remote repository.<br>
  Please make sure you have the correct access rights
  and the repository exists.</p>
</blockquote>