title: Keeping multiple read-only copies of a git repository
body: <p>I have a repository on github.com that I git pull down to my workstation, edit, commit then git push the changes back to github. This all works fine.</p>
  
  <p>But I often clone read-only copies from github.com using e.g.:</p>
  
  <pre><code>git clone git://github.com/jhsrennie/Test.git Test-ro
  </code></pre>
  
  <p>Typically this is because I have temporary test installations that I won't be developing on, but I need to check the code builds and runs. The copy of my github repository can be read-only because no changes will ever need pushing back to github. The trouble is that when I pull down changes from github to my read-only copy using:</p>
  
  <pre><code>git pull origin master
  </code></pre>
  
  <p>I now find that git status shows something like:</p>
  
  <pre><code>$ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 1 commit.
  #   (use "git push" to publish your local commits)
  </code></pre>
  
  <p>I can't push the changes back, and I wouldn't want to anyway, but the outstanding commits cause me problems e.g. I can't check out new remote branches. I end up having to delete my read-only repository and re-clone it every time I need to update it.</p>
  
  <p>How can I update my read-only copies of my github repository from github.com without causing them to think there are commits I need to push?</p>
  
  <p>Alternatively, am I doing this in a silly way and is there a better way to achieve my goal?</p>
  
  <h2>Response to Cupcake's answer</h2>
  
  <p>It seems strange to me as well, and there's clearly something I'm missing. This is how to reproduce the problem:</p>
  
  <ul>
  <li>Clone the repository with: <code>git clone git@github.com:jhsrennie/Test.git Test-rw</code></li>
  <li>Clone the readonly copy with: <code>git clone git://github.com/jhsrennie/Test.git Test-ro</code></li>
  <li>Make changes to <code>Test-rw</code>, then <code>git add</code> and <code>git commit</code></li>
  </ul>
  
  <p><code>git status</code> now shows (as you'd expect):</p>
  
  <pre><code>renniej@RATHAUS /d/Dev/GIT/Test-rw (master)
  $ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 1 commit.
  </code></pre>
  
  <p>And finally I push the change up to github with <code>git push origin master</code></p>
  
  <p>Now switch to the read-only copy and check that <code>git status</code> shows:</p>
  
  <pre><code>renniej@RATHAUS /d/Dev/GIT/Test-ro (master)
  $ git status
  # On branch master
  nothing to commit, working directory clean
  </code></pre>
  
  <p>Update it using <code>git pull origin master</code> and I get (this was a change to the single file README.md):</p>
  
  <pre><code>renniej@RATHAUS /d/Dev/GIT/Test-ro (master)
  $ git pull origin master
  remote: Counting objects: 5, done.
  remote: Compressing objects: 100% (2/2), done.
  remote: Total 3 (delta 0), reused 3 (delta 0)
  Unpacking objects: 100% (3/3), done.
  From git://github.com/jhsrennie/Test
   * branch            master     -&gt; FETCH_HEAD
  Updating 76b02d1..5b03266
  Fast-forward
   README.md | 2 ++
   1 file changed, 2 insertions(+)
  </code></pre>
  
  <p>and <code>git status</code> now gives:</p>
  
  <pre><code>renniej@RATHAUS /d/Dev/GIT/Test-ro (master)
  $ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 1 commit.
  </code></pre>
  
  <p>The only explanation I can think of is that the read-only copy doesn't recognise that the updates have come from the same repository that it was originally cloned from, but this seems strange to say the least.</p>