title: Automatic checkout after push
body: <p>I have a server on which I send the results of my work. After each command <code>git push</code> I have to connect via SSH and enter the command to switch my remote repository to the latest version:</p>
  
  <pre><code>git checkout NNNN
  </code></pre>
  
  <p>Can I simplify this action?</p>
  
  <p>P.S. Before submitting of this question I had found some information about GitHooks. Can I use it for my task described above and, for example for restarting Rails server after checkout?</p>