title: Condition on a directory having a git remote
body: <p>I'm writing a shell script to automatically update several directories of git repos, and I want to ignore repos that do not have a remote origin to pull from. So far I have</p>
  
  <pre><code>if git remote 2&gt;&amp;1 &gt;/dev/null; then
  </code></pre>
  
  <p>which successfully determines whether a directory is a git repo. But for any new git repo,</p>
  
  <pre><code>git remote
  </code></pre>
  
  <p>returns "origin" and an error status of 0. How do I distinguish between such repos and a repo where the command <code>git pull</code> will do something?</p>
  
  <p>I could use</p>
  
  <pre><code>git remote show origin
  </code></pre>
  
  <p>but this will connect to the origin server if it exists, and I'd prefer a command that's fast and local.</p>