title: How to force the checkout of the latest revision from a remote server?
body: <p>I have repository on GitHub to which I commit regularly from my local computer. On the other side I have server pulling from the repository. The web server just executes a <code>git pull</code> in order to get the latest changes from the GitHub repository. This is completely automated and should stay that way (solutions like the Ruby Tool Capistrano are out).</p>
  
  <p>A simple <code>git pull</code> usually works just fine. However, sometimes I change the last commit (<code>git commit --amend</code>) and <code>git push</code> the changes twice to GitHub. If the server auto-updated it's code between the two pushes to GitHub, the next server side <code>git pull</code> fails because there is merge conflict.</p>
  
  <p>To solve this problem I need the following behavior: The server should continue to <code>git pull</code> (or something equivalent) the GitHub repository but in case of a merge conflict, the GitHub repository should just take precedence over the local repository on the server. So, I want a git command that behaves like <code>git clone</code>, but doesn't copy the whole repository every single time.</p>