Quick sanity check – I wanted to create a new remote branch for myself. I want to do the following:
git clone git@github.com:orange/orange.git
git branch foo
git checkout foo
git push foo foo
I’d like to simply clone master, create a new branch named “foo” (using what was in master), then push it to a remote repo called “foo”. Does the above do that? The last line seems a little weird, in that I’m naming “foo” twice.
Thanks
I think you are confused by the term “remote.” A remote is a repository that exists somewhere else. A remote repository has branches; these are called “remote branches.” If your goal is to push your local
foobranch to the repository that you just cloned then:When you
git clone, Git creates a remote calledorigin. So this is the remote you want to push to. Yourgit pushline assumes that there is a remote calledfoo. If you have not explicitly created one, then it doesn’t exist.