How to push from one branch to another and checkout?
I am trying to implement the setup outlined here http://toroid.org/ams/git-website-howto but with one difference. On my local repository I want to use a branch different to master.
So when I go to push the initial files rather than push the master files I want to push the files from my demo branch to the master branch on the remote repository. For example:
git push web +master:refs/heads/demo
But when I do this I get the following error after it completes uploading all of the files:
remote: fatal: You are on a branch yet to be born
Is it possible to do what I am trying to do with this setup?
If the local branch is called "demo" and you want to push to branch called "master" on the remote called "web", then do the following:
git push web demo:master
If you want to merge from the "master" branch on the remote "web" into your current branch, you can do the following:
git fetch web
git merge web/master