tags:

views:

51

answers:

1

Git is making me pull my hair out. I know how to create a local branch that tracks a remote branch, but I want to create a remote branch which copies another remote branch, and then track. Creating a remote branch is also easy, but it seems to always uses the codebase in master, not in an arbitrary branch. What's the sequence of commands I need if I have these branches

origin/master
origin/somebranch

and I want

*somebranch2
origin/master
origin/somebranch
origin/somebranch2
+3  A: 
git push origin origin/somebranch:refs/heads/somebranch2
git branch -b somebranch2 origin/somebranch2

The first command is the most direct way of making a copy of a branch on a remote. The second command is simply for setting up the local branch (and it will track the new remote branch origin/somebranch2).

Dan Moulding
I had just found this: http://github.com/guides/copy-a-remote-branchWhich worked for me. I hope it's actually as simple as you say.
floyd