title: Branch git for a side project
body: <p>I am a git newbie so forgive my lack of knowledge but I am not even sure what questions to search google for.</p>
  
  <p>I have a large project only I am working on being developed locally and pushed to a remote webserver with git.  The server has a post-receive hook which copies the files for serving with this command:</p>
  
  <pre><code>GIT_WORK_TREE=/my/remote/webserver/base/directory git checkout -f
  </code></pre>
  
  <p>This has been working fine for months.</p>
  
  <p>Now, <b>I want to build a spinoff and run the new branch on my webserver</b>. I also want to be able to <b>switch back and forth between spinoff and master branches and overwrite the server's code</b> so that I can develop two separate websites simultaneously with only one server.  To start, I create a new git branch:</p>
  
  <pre><code>git checkout -b spinoff
  </code></pre>
  
  <p>I added a line and did a commit:</p>
  
  <pre><code>git commit -a -m 'test'
   [spinoff 51f90e9] test
   1 file changed, 1 insertion(+)
  </code></pre>
  
  <p>Now, I am trying to push to the remote branch. This does not work</p>
  
  <pre><code>git push origin master
   (everything up to date)
  </code></pre>
  
  <p>This command pushes as expected but does not copy the files over the web server</p>
  
  <pre><code>git push origin spinoff
  </code></pre>
  
  <p>Setting it up to push to the master doesn't seem to help:</p>
  
  <pre><code>git branch --set-upstream spinoff origin/master
  </code></pre>
  
  <p>[edited as pointed out by @Klas Mellbourn] That is the syntax for git 1.7.<em>. If you have git 1.8.</em>, the syntax is:</p>
  
  <pre><code>git branch -u origin spinoff
  </code></pre>
  
  <p>I know I am missing some <b>big key concept</b> here. My guess is that there are two remote repositories as expected but I need to set up something else to copy from the spinoff repo to the webserver.</p>
  
  <p>I think I might have to edit the HEAD file in my remote repository? This currently contains:</p>
  
  <pre><code>ref: refs/heads/master
  </code></pre>