Re: Making git disappear when talking about my code (was: Re: GIT vs Other: Need argument)
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 25, 2007, 14:55 UTC
- Message-ID
- <alpine.LFD.0.98.0704250751330.9964@woody.linux-foundation.org>
- In-Reply-To
- <87k5w07dft.wl%cworth@cworth.org>
On Wed, 25 Apr 2007, Carl Worth wrote:
> > Oops. I just noticed that that last command is wrong. Instead of "git > checkout --track -b <branch>" that should of course be "git checkout > --track -b <branch> origin/<branch>".
No, it really should be
git branch --track newbranch origin/oldbranch
followed by
git checkout newbranch
and then it's not so hard. It's two commands, but it's two _simpler_ commands, that make sense on their own. Don't use the complex version: it's a "expert mode" command that just knows how to do both.
Alternatively, we *could* make just
git checkout --track branch
be a shorthand for
git checkout --track -b branch origin/branch
when "branch" doesn't exist, but origin/branch does. With the "--track", it's already unambiguous (you cannot track a detached head, so we know we want a branch.
Linus