Re: GIT vs Other: Need argument
From: Brian Gernhardt <hidden>
Date: 2016-06-15 22:43:06
On Apr 23, 2007, at 7:24 PM, Linus Torvalds wrote:
So I don't really see the problem with just saying: - the remote *has* a default branch. That's the one you get by default with "git clone". - if you want to track another branch, you should just tell git that you want to track it, and switch to that instead: git branch --track mybranch origin/otherbranch git checkout mybranch and be happy with it. Yes, it's two extra commands, but they aren't *that* hard to explain, after all. You really can basically explain each stage both very simply and naturally with just
It's even better than that. Just use "git checkout --track -b mybranch origin/otherbranch". Slightly cumbersome, but is only one command. And easily explained: "Checkout a tracking branch named mybranch for origin/otherbranch". And the --track can be removed by using branch.autosetupmerge for people who always want it. Actually the man page appears to be minorly incorrect. It has "[-b [ --track | --no-track ]", which doesn't work. Git gives me "git checkout: updating paths is incompatible with switching branches/ forcing". I think it's interpreting --track as the new branch name. I'll send a patch reversing the order of the arguments in the man page. ~~ Brian