{"thread":{"id":"6985","subject":"Pulling peer's branch and getting tracking branch created","startedAt":"2007-02-27T00:37:51Z","lastAt":"2007-02-27T01:24:01Z","messageCount":7,"participants":["Bill Lear","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"35559","messageId":"17891.32095.655545.637691@lisa.zopyra.com","threadId":"6985","inReplyTo":null,"subject":"Pulling peer's branch and getting tracking branch created","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-02-27T00:37:51Z","receivedAt":"2007-02-27T00:37:51Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"I can't seem to figure out the correct magic to get my buddy's branch,\nand create the appropriate tracking branch at the same time without\ndoing a clone.\n\nI don't want to branch from my master, just get his branch and the\nmatching tracking branch...\n\nIt's been a long day, so sorry for the simplistic question, but how\ndo I do this exactly?\n\n\nBill\n"},{"id":"35562","messageId":"7v7iu4l8k0.fsf@assigned-by-dhcp.cox.net","threadId":"6985","inReplyTo":"17891.32095.655545.637691@lisa.zopyra.com","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T00:59:27Z","receivedAt":"2007-02-27T00:59:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> I can't seem to figure out the correct magic to get my buddy's branch,\n> and create the appropriate tracking branch at the same time without\n> doing a clone.\n\nI'll cheat and ask \"git show b6f5da1e\" ;-).\n\n\t$ git remote add -f -m master bob ../bob.git/\n\nwhich should add:\n\n\t[remote \"bob\"]\n        \turl = ../bob.git/\n\t\tfetch = +refs/heads/*:refs/remotes/bob/*\n\nto .git/config, and perform the initial \"git fetch bob\" so that\nbob's heads appear under your .git/refs/remotes/bob/*, iow,\nafter this, you can ask:\n\n\t$ git branch -r\n\t  bob/HEAD\n          bob/master\n          bob/topic-1\n          bob/topic-2\n          ...\n"},{"id":"35563","messageId":"17891.33709.278100.35712@lisa.zopyra.com","threadId":"6985","inReplyTo":"7v7iu4l8k0.fsf@assigned-by-dhcp.cox.net","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-02-27T01:04:45Z","receivedAt":"2007-02-27T01:04:45Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:\n>Bill Lear <rael@zopyra.com> writes:\n>\n>> I can't seem to figure out the correct magic to get my buddy's branch,\n>> and create the appropriate tracking branch at the same time without\n>> doing a clone.\n>\n>I'll cheat and ask \"git show b6f5da1e\" ;-).\n>\n>\t$ git remote add -f -m master bob ../bob.git/\n>\n>which should add:\n>\n>\t[remote \"bob\"]\n>        \turl = ../bob.git/\n>\t\tfetch = +refs/heads/*:refs/remotes/bob/*\n>\n>to .git/config, and perform the initial \"git fetch bob\" so that\n>bob's heads appear under your .git/refs/remotes/bob/*, iow,\n>after this, you can ask:\n>\n>\t$ git branch -r\n>\t  bob/HEAD\n>          bob/master\n>          bob/topic-1\n>          bob/topic-2\n\nOk, and then:\n\n% git checkout -b topic-1 bob/topic-1\n\nGets me onto a topic branch ...\n\nSo, this does do what I've asked, and more: however, how can I get it\nto do only the one branch that I want and not all of the others?  If\nthis part is really annoyingly hard and/or stupid, don't hesitate to\nsay so.\n\n\nBill\n"},{"id":"35564","messageId":"7v3b4sl88s.fsf@assigned-by-dhcp.cox.net","threadId":"6985","inReplyTo":"17891.33709.278100.35712@lisa.zopyra.com","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T01:06:11Z","receivedAt":"2007-02-27T01:06:11Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:\n>>Bill Lear <rael@zopyra.com> writes:\n>>\n>>> I can't seem to figure out the correct magic to get my buddy's branch,\n>>> and create the appropriate tracking branch at the same time without\n>>> doing a clone.\n>>\n>>I'll cheat and ask \"git show b6f5da1e\" ;-).\n>>\n>>\t$ git remote add -f -m master bob ../bob.git/\n>>\n>>which should add:\n>>\n>>\t[remote \"bob\"]\n>>        \turl = ../bob.git/\n>>\t\tfetch = +refs/heads/*:refs/remotes/bob/*\n>>\n>>to .git/config, and perform the initial \"git fetch bob\" so that\n>>bob's heads appear under your .git/refs/remotes/bob/*, iow,\n>>after this, you can ask:\n>>\n>>\t$ git branch -r\n>>\t  bob/HEAD\n>>          bob/master\n>>          bob/topic-1\n>>          bob/topic-2\n>\n> Ok, and then:\n>\n> % git checkout -b topic-1 bob/topic-1\n>\n> Gets me onto a topic branch ...\n>\n> So, this does do what I've asked, and more: however, how can I get it\n> to do only the one branch that I want and not all of the others?  If\n> this part is really annoyingly hard and/or stupid, don't hesitate to\n> say so.\n\nThis time, I'll cheat and ask you to ask \"git show b6f5da1e\"\n;-).\n"},{"id":"35565","messageId":"17891.33854.166609.651544@lisa.zopyra.com","threadId":"6985","inReplyTo":"7v7iu4l8k0.fsf@assigned-by-dhcp.cox.net","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-02-27T01:07:10Z","receivedAt":"2007-02-27T01:07:10Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:\n>Bill Lear <rael@zopyra.com> writes:\n>\n>> I can't seem to figure out the correct magic to get my buddy's branch,\n>> and create the appropriate tracking branch at the same time without\n>> doing a clone.\n>\n>I'll cheat and ask \"git show b6f5da1e\" ;-).\n>\n>\t$ git remote add -f -m master bob ../bob.git/\n\nSorry, should have asked: what doe \"-f -m master\" mean?  I looked in\nthe man page, but didn't see anything on this.\n\n\nBill\n"},{"id":"35566","messageId":"7vy7mkjtc8.fsf@assigned-by-dhcp.cox.net","threadId":"6985","inReplyTo":"17891.33854.166609.651544@lisa.zopyra.com","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-27T01:13:27Z","receivedAt":"2007-02-27T01:13:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:\n>>Bill Lear <rael@zopyra.com> writes:\n>>\n>>> I can't seem to figure out the correct magic to get my buddy's branch,\n>>> and create the appropriate tracking branch at the same time without\n>>> doing a clone.\n>>\n>>I'll cheat and ask \"git show b6f5da1e\" ;-).\n>>\n>>\t$ git remote add -f -m master bob ../bob.git/\n>\n> Sorry, should have asked: what doe \"-f -m master\" mean?  I looked in\n> the man page, but didn't see anything on this.\n\nI should be the one who's saying sorry.  I realized it was not\ndocumented and updated the doc last night.  Here is an excerpt:\n\n    'add'::\n\n    Adds a remote named <name> for the repository at\n    <url>.  The command `git fetch <name>` can then be used to create and\n    update remote-tracking branches <name>/<branch>.\n\n    With `-f` option, `git fetch <name>` is run immediately after\n    the remote information is set up.\n\n    With `-t <branch>` option, instead of the default glob\n    refspec for the remote to track all branches under\n    `$GIT_DIR/remotes/<name>/`, a refspec to track only `<branch>`\n    is created.  You can give more than one `-t <branch>` to track\n    multiple branche without grabbing all branches.\n\n    With `-m <master>` option, `$GIT_DIR/remotes/<name>/HEAD` is set\n    up to point at remote's `<master>` branch instead of whatever\n    branch the `HEAD` at the remote repository actually points at.\n\nBut I realize that the commit log message of b6f5da should\nprobably be massaged into the EXAMPLES section.\n\n\ncommit b6f5da1e0f4eeb59798b320f97d27f83d19f89df\nAuthor: Junio C Hamano <junkio@cox.net>\nDate:   Thu Feb 1 23:30:03 2007 -0800\n\n    Teach git-remote add to fetch and track\n    \n    This adds three options to 'git-remote add'.\n    \n     * -f (or --fetch) option tells it to also run the initial \"git\n        fetch\" using the newly created remote shorthand.\n    \n     * -t (or --track) option tells it not to use the default\n        wildcard to track all branches.\n    \n     * -m (or --master) option tells it to make the\n        remote/$name/HEAD point at a remote tracking branch other\n        than master.\n    \n    For example, with this I can say:\n    \n      $ git remote add -f -t master -t quick-start -m master \\\n        jbf-um git://linux-nfs.org/~bfields/git.git/\n    \n    to\n    \n     (1) create remote.jbf-um.url;\n    \n     (2) track master and quick-start branches (and no other); the\n         two -t options create these two lines:\n    \n           fetch = +refs/heads/master:refs/remotes/jbf-um/master\n           fetch = +refs/heads/quick-start:refs/remotes/jbf-um/quick-start\n    \n     (3) set up remotes/jbf-um/HEAD to point at jbf-um/master so\n         that later I can say \"git log jbf-um\"\n    \n    Or I could do\n    \n      $ git remote add -t 'ap/*' andy /home/andy/git.git\n    \n    to make Andy's topic branches kept track of under refs/remotes/andy/ap/.\n    \n    Other possible improvements I considered but haven't implemented\n    (hint, hint) are:\n    \n     * reject wildcard letters other than a trailing '*' to the -t\n       parameter;\n    \n     * make -m optional and when the first -t parameter does not\n       have the trailing '*' default to that value (so the above\n       example does not need to say \"-m master\");\n    \n     * if -m is not given, and -t parameter ends with '*' (i.e. the\n       above defaulting did not tell us where to point HEAD at), and\n       if we did the fetch with -f, check if 'master' was fetched\n       and make HEAD point at it.\n    \n    Signed-off-by: Junio C Hamano <junkio@cox.net>\n"},{"id":"35568","messageId":"17891.34865.91784.71777@lisa.zopyra.com","threadId":"6985","inReplyTo":"7vy7mkjtc8.fsf@assigned-by-dhcp.cox.net","subject":"Re: Pulling peer's branch and getting tracking branch created","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-02-27T01:24:01Z","receivedAt":"2007-02-27T01:24:01Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Monday, February 26, 2007 at 17:13:27 (-0800) Junio C Hamano writes:\n>Bill Lear <rael@zopyra.com> writes:\n>> On Monday, February 26, 2007 at 16:59:27 (-0800) Junio C Hamano writes:\n>>>\n>>>\t$ git remote add -f -m master bob ../bob.git/\n>>\n>> Sorry, should have asked: what doe \"-f -m master\" mean?  I looked in\n>> the man page, but didn't see anything on this.\n>\n>I should be the one who's saying sorry.  I realized it was not\n>documented and updated the doc last night.  Here is an excerpt:\n\nNo problems.  As usual, superlative support here on the git list.\n\nThanks very much.\n\n\nBill\n"}]}