{"thread":{"id":"34596","subject":"change remote to track new branch","startedAt":"2013-08-03T02:40:32Z","lastAt":"2013-08-07T02:40:32Z","messageCount":8,"participants":["Daniel Convissor","Andreas Schwab","Jonathan Nieder","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"224482","messageId":"20130803024032.GA28666@analysisandsolutions.com","threadId":"34596","inReplyTo":null,"subject":"change remote to track new branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2013-08-03T02:40:32Z","receivedAt":"2013-08-03T02:40:32Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hi:\n\nLong ago I added a remote to my repo.  It is set to track what was then\nWordPress' main release branch (3.4-branch) and created a local branch\nto use it.  Well, time marches on.  I want to update my remote and\nbranch to track the new main release branch (3.6-branch).\n\nHere's how I set things up at the time:\n\ngit remote add -t 3.4-branch -f wp https://github.com/WordPress/WordPress\ngit checkout -b wp wp/3.4-branch\n\nI've tried various fetch, remote and branch commands to effectuate this\nchange, to no avail.  I get messages like \"Not a valid ref.\"\n\nI know a major part of this is that my repo only knows of one remote\nbranch (of the many that exist).  What I don't know are the commands\nneeded to fetch the right remote branch, set my remote and local branch\nto track it.  Your help will be appreciated, please.\n\nHere's some information on the current state of things:\n\nvvvvvvvvvvvvvvvvvvvv\n^^^^^^^^^^^^^^^^^^^^\ngit branch -av\n  dev                                 a18677e [ahead 153] backup of 3.4 db\n  master                              0d6f9b5 Merge branch 'dev'\n\n* wp                                  42abc67 [ahead 5] Merge branch\n'3.4-branch' of https://github.com/WordPress/WordPress into wp\n\n  remotes/git_push_deployer/wordpress c8a5d69 Make my branch names generic.\n  remotes/prod/HEAD                   -> prod/master\n  remotes/prod/master                 0d6f9b5 Merge branch 'dev'\n  remotes/wp/3.4-branch               b535358 POT, generated from r24100\n  remotes/wpconfig/master             3e45a81 LSS 0.27.0.\n^^^^^^^^^^^^^^^^^^^^\n\nvvvvvvvvvvvvvvvvvvvv\ngit remote show wp\n* remote wp\n  Fetch URL: https://github.com/WordPress/WordPress\n  Push  URL: https://github.com/WordPress/WordPress\n  HEAD branch: master\n  Remote branch:\n    3.4-branch tracked\n  Local branch configured for 'git pull':\n    wp merges with remote 3.4-branch\n  Local ref configured for 'git push':\n    master pushes to master (local out of date)\n^^^^^^^^^^^^^^^^^^^^\n\nThanks,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n        4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335\n"},{"id":"224494","messageId":"m2d2pvp7nw.fsf@linux-m68k.org","threadId":"34596","inReplyTo":"20130803024032.GA28666@analysisandsolutions.com","subject":"Re: change remote to track new branch","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-08-03T07:14:59Z","receivedAt":"2013-08-03T07:14:59Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Daniel Convissor <danielc@analysisandsolutions.com> writes:\n\n> Long ago I added a remote to my repo.  It is set to track what was then\n> WordPress' main release branch (3.4-branch) and created a local branch\n> to use it.  Well, time marches on.  I want to update my remote and\n> branch to track the new main release branch (3.6-branch).\n>\n> Here's how I set things up at the time:\n>\n> git remote add -t 3.4-branch -f wp https://github.com/WordPress/WordPress\n> git checkout -b wp wp/3.4-branch\n\nUse \"git remote set-branches\" to change the tracked branches of a\nremote.  Use \"git branch --set-upstream-to\" to change the upstream of a\nbranch (or create a new branch from the new upstream).\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"224526","messageId":"20130803162821.GA945@analysisandsolutions.com","threadId":"34596","inReplyTo":"m2d2pvp7nw.fsf@linux-m68k.org","subject":"Re: change remote to track new branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2013-08-03T16:28:21Z","receivedAt":"2013-08-03T16:28:21Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hi Andreas:\n\nOn Sat, Aug 03, 2013 at 09:14:59AM +0200, Andreas Schwab wrote:\n> Daniel Convissor <danielc@analysisandsolutions.com> writes:\n> \n> > Long ago I added a remote to my repo.  It is set to track what was then\n> > WordPress' main release branch (3.4-branch) and created a local branch\n> > to use it.  Well, time marches on.  I want to update my remote and\n> > branch to track the new main release branch (3.6-branch).\n> >\n> > Here's how I set things up at the time:\n> >\n> > git remote add -t 3.4-branch -f wp https://github.com/WordPress/WordPress\n> > git checkout -b wp wp/3.4-branch\n> \n> Use \"git remote set-branches\" to change the tracked branches of a\n> remote.  Use \"git branch --set-upstream-to\" to change the upstream of a\n> branch (or create a new branch from the new upstream).\n\nThanks.  Those commands were introduced in 1.8.  Is there a way to do it\nin 1.7, please?\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n        4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335\n"},{"id":"224529","messageId":"87iozmhgl1.fsf@igel.home","threadId":"34596","inReplyTo":"20130803162821.GA945@analysisandsolutions.com","subject":"Re: change remote to track new branch","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-08-03T16:41:46Z","receivedAt":"2013-08-03T16:41:46Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Daniel Convissor <danielc@analysisandsolutions.com> writes:\n\n> Thanks.  Those commands were introduced in 1.8.  Is there a way to do it\n> in 1.7, please?\n\nUse git config.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"224530","messageId":"20130803165215.GC945@analysisandsolutions.com","threadId":"34596","inReplyTo":"87iozmhgl1.fsf@igel.home","subject":"Re: change remote to track new branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2013-08-03T16:52:15Z","receivedAt":"2013-08-03T16:52:15Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hi Andreas:\n\nOn Sat, Aug 03, 2013 at 06:41:46PM +0200, Andreas Schwab wrote:\n> Daniel Convissor <danielc@analysisandsolutions.com> writes:\n> \n> Use git config.\n\nYeah.  I had contemplated using the following commands:\n\n    git config remote.wp.fetch \\\n        \"+refs/heads/3.6-branch:refs/remotes/wp/3.6-branch\"\n    git config branch.wp.merge \"refs/heads/3.6-branch\"\n\nSo is \"git remote set-branches\" and \"git branch --set-upstream-to\" just\nanother syntax for making those same changes to git config?  Or do the\nnew commands do some additional work on the repository (to better keep\ntrack of things, or whatever)?\n\nThanks,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n        4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335\n"},{"id":"224534","messageId":"20130803170519.GC2893@elie.Belkin","threadId":"34596","inReplyTo":"20130803162821.GA945@analysisandsolutions.com","subject":"Re: change remote to track new branch","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-08-03T17:05:19Z","receivedAt":"2013-08-03T17:05:19Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Daniel Convissor wrote:\n> On Sat, Aug 03, 2013 at 09:14:59AM +0200, Andreas Schwab wrote:\n\n>> Use \"git remote set-branches\" to change the tracked branches of a\n>> remote.  Use \"git branch --set-upstream-to\" to change the upstream of a\n>> branch (or create a new branch from the new upstream).\n>\n> Thanks.  Those commands were introduced in 1.8.  Is there a way to do it\n> in 1.7, please?\n\n\"git remote set-branches\" was introduced by v1.7.8-rc2~4^2~1.  Are you\nstuck on 1.7.2.5, perhaps?  In older (and current) versions of git,\nyou can control the list of branches tracked by a remote by modifying\nits \"fetch\" refspec in .git/config:\n\n\t[remote \"origin\"]\n\t\turl = ...\n\t\tfetch = +refs/heads/master:refs/remotes/origin/master\n\t\tfetch = +refs/heads/next:refs/remotes/origin/next\n\n\"git branch --set-upstream-to\" is from v1.8.0-rc0~50^2~4.  In older\nversions of git,\n\n\tgit branch --set-upstream-to=origin/master master\n\nwas spelled as\n\n\tgit branch --set-upstream master origin/master\n\nor the branch's upstream can be set directly in .git/config by\nmodifying the \"remote\" and \"merge\" values in the [branch \"foo\"]\nparagraph.\n\nHope that helps,\nJonathan\n"},{"id":"224727","messageId":"20130807003053.GA7145@analysisandsolutions.com","threadId":"34596","inReplyTo":"20130803165215.GC945@analysisandsolutions.com","subject":"Re: change remote to track new branch","fromName":"Daniel Convissor","fromEmail":"danielc@analysisandsolutions.com","sentAt":"2013-08-07T00:30:53Z","receivedAt":"2013-08-07T00:30:53Z","isPatch":false,"sender":{"key":"danielc@analysisandsolutions.com","avatar":"https://gravatar.com/avatar/6934d176616faccef0fe2329329c24e2a2d92783d565704c7c4f85ea9219d412?d=mp&s=160"},"body":"Hi Folks:\n\nOn Sat, Aug 03, 2013 at 12:52:15PM -0400, Daniel Convissor wrote:\n> \n> Yeah.  I had contemplated using the following commands:\n> \n>     git config remote.wp.fetch \\\n>         \"+refs/heads/3.6-branch:refs/remotes/wp/3.6-branch\"\n>     git config branch.wp.merge \"refs/heads/3.6-branch\"\n> \n> So is \"git remote set-branches\" and \"git branch --set-upstream-to\" just\n> another syntax for making those same changes to git config?  Or do the\n> new commands do some additional work on the repository (to better keep\n> track of things, or whatever)?\n\nSorry to be a pest, but I'm curious what the answer is, please.\n\nThank you,\n\n--Dan\n\n-- \n T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y\n            data intensive web and database programming\n                http://www.AnalysisAndSolutions.com/\n        4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335\n"},{"id":"224728","messageId":"CAJDDKr5d=ifToosL2w5mJMyhiWwYK_eeuxEQTrDssVBe4P6JLA@mail.gmail.com","threadId":"34596","inReplyTo":"20130807003053.GA7145@analysisandsolutions.com","subject":"Re: change remote to track new branch","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-08-07T02:40:32Z","receivedAt":"2013-08-07T02:40:32Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Aug 6, 2013 at 5:30 PM, Daniel Convissor\n<danielc@analysisandsolutions.com> wrote:\n> Hi Folks:\n>\n> On Sat, Aug 03, 2013 at 12:52:15PM -0400, Daniel Convissor wrote:\n>>\n>> Yeah.  I had contemplated using the following commands:\n>>\n>>     git config remote.wp.fetch \\\n>>         \"+refs/heads/3.6-branch:refs/remotes/wp/3.6-branch\"\n>>     git config branch.wp.merge \"refs/heads/3.6-branch\"\n>>\n>> So is \"git remote set-branches\" and \"git branch --set-upstream-to\" just\n>> another syntax for making those same changes to git config?  Or do the\n>> new commands do some additional work on the repository (to better keep\n>> track of things, or whatever)?\n>\n> Sorry to be a pest, but I'm curious what the answer is, please.\n\nThere's really nothing more to it.\n\nThere is one other setting -- \"branch.wp.remote\" should be set to \"wp\".\n\nIf you edit your .git/config by hand you'll see what's really going\non.  It's quite simple under the hood.\n-- \nDavid\n"}]}