Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Pulling peer's branch and getting tracking branch created

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:56

Bill Lear [off-list ref] writes:
On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:
quoted
Bill Lear [off-list ref] writes:
quoted
I can't seem to figure out the correct magic to get my buddy's branch,
and create the appropriate tracking branch at the same time without
doing a clone.
I'll cheat and ask "git show b6f5da1e" ;-).

$ git remote add -f -m master bob ../bob.git/

which should add:

[remote "bob"]
       	url = ../bob.git/
	fetch = +refs/heads/*:refs/remotes/bob/*

to .git/config, and perform the initial "git fetch bob" so that
bob's heads appear under your .git/refs/remotes/bob/*, iow,
after this, you can ask:

$ git branch -r
  bob/HEAD
         bob/master
         bob/topic-1
         bob/topic-2
Ok, and then:

% git checkout -b topic-1 bob/topic-1

Gets me onto a topic branch ...

So, this does do what I've asked, and more: however, how can I get it
to do only the one branch that I want and not all of the others?  If
this part is really annoyingly hard and/or stupid, don't hesitate to
say so.
This time, I'll cheat and ask you to ask "git show b6f5da1e"
;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help