Wow...just wow. Why would you do this to yourselves?
First of all,
git push origin origin:refs/heads/${branch_name}
is totally unnecessary when creating a new branch.
I see that there are remote branches you want to track. It's simple, no need for a script. Just make sure you are synced with the current version of the repo you are using (using `git pull`). Then:
git checkout --track -b bugfix origin/bugfix
Easy as pie. I even have an alias set when I want to do this, so I just call
git cot bugfix origin/bugfix
To create a new branch locally (that doesn't track a remote), just call
git checkout -b new-feature
Note: When using `git pull`, `git fetch` doesn't need to be called. Pulling changes will fetch them for you automatically.
# this creates the branch and switches to it (i.e. does a checkout)
git checkout -b new-feature
The only diff is -b, which is fine to me because it makes it clear that you are doing two things. You don't need the origin/newfeature stuff for the common case. I'm assuming this is what 'hg branch new-feature' is doing. How do you create a branch and not switch to it?
'hg branch foo' just marks the working directory as branch foo. The 'hg update default' would then update back to the default branch and mark the working directory as being on 'default'.
To really just create a new branch you do: 'hg branch foo; hg commit -m "Create a new branch."' Two steps, but like you said, it's probably not something you'd be doing very often anyway.
I don't presume to know what is necessary by everyone's situation. If the argument is that mercurial is better because you don't have to use -b, well that's weak sauce.
Also, while it makes it 'a bit annoying' for people like me, I wonder if it will rule git out when it comes to Big Companies and people who are not so computer literate. The last time I looked at the git/windows thing, it was pretty ugly and not nearly as easy to use as turtlesvn.
Without more information, I can't really say if you're contradicting me thesis or not. I can easily imagine a small group of git users in any big company, but not so much a larger group that includes a lot of less technical users.
First of all,
is totally unnecessary when creating a new branch.I see that there are remote branches you want to track. It's simple, no need for a script. Just make sure you are synced with the current version of the repo you are using (using `git pull`). Then:
Easy as pie. I even have an alias set when I want to do this, so I just call To create a new branch locally (that doesn't track a remote), just call Note: When using `git pull`, `git fetch` doesn't need to be called. Pulling changes will fetch them for you automatically.