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?
Push Branch to Another Branch In some cases, you may want to push your changes to another branch on the remote repository. In order to push your branch to another remote branch, use the “git push” command and specify the remote name, the name of your local branch as the name of the remote branch.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With