title: Server deployment using git hooks not working
body: <p>While using windows 10 in local machine and ubuntu vps server, I am trying to make auto deployment using git hooks from local to server. I configured my ubuntu server as following :</p>
  <pre><code>root@server:~# cd /var
  root@server:~# mkdir repo &amp;&amp; cd repo
  root@server:~# mkdir site.git &amp;&amp; cd site.git
  root@server:~# git init --bare
  root@server:~# cd hooks
  root@server:~# touch post-receive &amp;&amp; nano post-receive 
  </code></pre>
  <p>and modified <code>post-receive</code> as following</p>
  <pre><code>#!/bin/sh
  git --work-tree=/var/www/site--git-dir=/var/repo/site.git checkout -f
  </code></pre>
  <p>After that in the local pc repo I executated the following command</p>
  <pre><code>git remote add production ssh://root@example.com/var/repo/site.git
  </code></pre>
  <p>now in local repo I've 3 branches like <code>master, branch1, branch2</code>. When I push the repo to server by
  <code>git push production master</code> it pushed the master branch to server. But when I push <code>git push production branch1</code>, it doesn't pushed the branch1. In <code>/var/www/site</code> I found the master branch.</p>
  <p>So I have two questions:</p>
  <ol>
  <li>How can I push other branches(not the master) to server.</li>
  <li>If I need to delete the production branch from local machine &amp; add new server destination how to do so ?</li>
  </ol>
  <p>Thanks in advance!</p>