Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [RFC] git-clone: add --track <headname> support

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:43:04

Carl Worth wrote:
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
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.
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 needed

cheers,


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
-----------------------------------------------------------------------
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help