Re: [RFC] git-clone: add --track <headname> support
- From
- Martin Langhoff <martin@catalyst.net.nz>
- Date
- Apr 12, 2007, 23:50 UTC
- Message-ID
- <461EC5DC.6060903@catalyst.net.nz>
- In-Reply-To
- <87slb5tbvu.wl%cworth@cworth.org>
Carl Worth wrote:
Show 8 quoted lines
> Is this correct sequence for the operation in 1.5.1 ? > > git clone <repo> > cd <project> > git branch --track <branch> origin/<branch> > git checkout branch > git pull # as needed >
Actually you don't need the git-checkout line
git clone <repo> cd <project> git branch --track <branch> origin/<branch> git pull # as needed
Show 5 quoted lines
> I'd love to get that down to: > > git clone <something with <repo> and <branch>> > cd <project> > git pull # as needed
That's what this patch does.
Show 5 quoted lines
> and then adding a subsequent branch to track would be: > > git track <something with <repo> and <branch>> > git checkout <branch> > git pull # as needed
If your tree is reasonably clean (so that the implied git-checkout won't fail), then on 1.5.1 this Just Works
git branch --track <branch> origin/<branch>
git pull # as neededcheers,
m
--
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224 UK: 0845 868 5733 ext 7224 MOB: +64(21)364-017
Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------