title: Git: Find which commit is checked out on a remote
body: <p>I have a local repo, and this repo has a remote. I want to know which commit (by SHA number) is checked out <strong>on the remote</strong>, assuming the remote is not a bare repository.</p>
  
  <p>Clarification: I don't want anything to do with tracking branches or any other kind of branches on my local repository. In fact I want a method that works even if my local repository is a bare repository. Imagine that my remote is <code>ssh://whatever/foo</code>, so I want to get the equivalent of SSHing into the server <code>whatever</code>, doing <code>cd /foo</code> and <code>git rev-parse HEAD</code>.</p>
  
  <p>I don't want to do the above example directly because I can't guarantee that I'll have SSH access to the remote. I want a method that works regardless of the type of remote</p>
  
  <p>I want the response to be a SHA, not a branch name</p>