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?

Answers


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

Need Your Help

Error: allowDefinition='MachineToApplication' beyond application level

asp.net visual-studio-2012

I have downloaded the online project in ASP.Net. While running application I get an error

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.