title: How to run git commands on remote without having local repo
body: <p>I have a script called 'git-export' which helps me to export a remote repository. It is run like that:</p>
  
  <pre><code>git-export http://host.com/git-repo &lt;-t tag or -b branch or -c commit&gt; /local/dir
  </code></pre>
  
  <p>Before it was used to export local repository and I used these commands:</p>
  
  <p>to get commit from branch:</p>
  
  <pre><code>git branch -v --no-abbrev|awk '($1=="'$BRANCH'") || ($1 == "*" &amp;&amp; $2 == "'$BRANCH'"){if($1 == "*"){print $3;}else{print $2;}}'
  </code></pre>
  
  <p>or </p>
  
  <pre><code>git rev-parse -q --verify $BRANCH^{commit}
  </code></pre>
  
  <p>to get commit by tag:</p>
  
  <pre><code>git rev-parse -q --verify $TAG^{commit}
  </code></pre>
  
  <p>also I have scripts to list tags, versions (tags, starting with v), I use git branch -v to show branches....</p>
  
  <p>Question is: How can I do these things on remote repository without having local. Is there some general way to query remote. For example: <code>git --remote=http://host.com/repo branch -v</code> or <code>git --remote=http://host.com/repo log</code></p>
  
  <p>Resion: If I want to install software on remote host I just want to</p>
  
  <ol>
  <li>list versions, branches, etc</li>
  <li>export specific version/branch/commit and show SHA1 of the commit regardless which one of these I export (by export I mean <code>git archive --remote=&lt;repo&gt;|tar x</code>)</li>
  </ol>
  
  <p>edit:</p>
  
  <p>I don't want to actionalyl run the commands on remote. I want to use the remote repository with local commands and display it formatted.</p>