{"thread":{"id":"19321","subject":"how to make \"pull\" always pulling the matching branch?","startedAt":"2009-05-12T19:21:40Z","lastAt":"2009-05-13T13:12:23Z","messageCount":2,"participants":["Oliver Kullmann","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"113687","messageId":"20090512192140.GK31826@cs-wsok.swansea.ac.uk","threadId":"19321","inReplyTo":null,"subject":"how to make \"pull\" always pulling the matching branch?","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2009-05-12T19:21:40Z","receivedAt":"2009-05-12T19:21:40Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Hello,\n\nuntil some time ago,\n\ngit pull remote-repo\n\nworked like that; alright, at some time\nwarning messages appeared, so I used\n\ngit pull remote-repo master\n\nI attempted several times to understand the\nstrange message issued by pull:\n--------------------\nYou asked me to pull without telling me which branch you\nwant to merge with, and 'branch.master.merge' in\nyour configuration file does not tell me either.        Please\nspecify which branch you want to merge on the command line and\ntry again (e.g. 'git pull <repository> <refspec>').\nSee git-pull(1) for details.\n\nIf you often merge with the same branch, you may want to\nconfigure the following variables in your configuration\nfile:\n\n    branch.master.remote = <nickname>\n    branch.master.merge = <remote-ref>\n    remote.<nickname>.url = <url>\n    remote.<nickname>.fetch = <refspec>\n\nSee git-config(1) for details.\n--------------------\nbut neither do I understand what could be meant here, nor\ndo I understand the details of git-pull or git-config w.r.t.\nthis issue (the above doesn't give a hint about the meaning\nof the possible actions).\n\nSo well, now the same thing happened with \"git push\", but here\nthe message actually is better and tells the reader what to do\n(nearly); so I specified \"matching\" for the config-variable \npush.default, and that's fine.\n\nI was hoping that there would also be a pull.default, which I could\nset to matching, but apparently there is nothing like that? How\ndo I achieve this?\n\nIt seems rather sensible to me to have this as the default: just\npull a matching branch, not more, not less --- what else could/should\nit be if nothing else is specified?\n\nOliver\n\nP.S. I'm using version 1.6.3.\n"},{"id":"113784","messageId":"4A0AC737.7030202@drmicha.warpmail.net","threadId":"19321","inReplyTo":"20090512192140.GK31826@cs-wsok.swansea.ac.uk","subject":"Re: how to make \"pull\" always pulling the matching branch?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-05-13T13:12:23Z","receivedAt":"2009-05-13T13:12:23Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Oliver Kullmann venit, vidit, dixit 12.05.2009 21:21:\n> Hello,\n> \n> until some time ago,\n> \n> git pull remote-repo\n> \n> worked like that; alright, at some time\n> warning messages appeared, so I used\n> \n> git pull remote-repo master\n> \n> I attempted several times to understand the\n> strange message issued by pull:\n> --------------------\n> You asked me to pull without telling me which branch you\n> want to merge with, and 'branch.master.merge' in\n> your configuration file does not tell me either.        Please\n> specify which branch you want to merge on the command line and\n> try again (e.g. 'git pull <repository> <refspec>').\n> See git-pull(1) for details.\n> \n> If you often merge with the same branch, you may want to\n> configure the following variables in your configuration\n> file:\n> \n>     branch.master.remote = <nickname>\n>     branch.master.merge = <remote-ref>\n>     remote.<nickname>.url = <url>\n>     remote.<nickname>.fetch = <refspec>\n> \n> See git-config(1) for details.\n> --------------------\n> but neither do I understand what could be meant here, nor\n> do I understand the details of git-pull or git-config w.r.t.\n> this issue (the above doesn't give a hint about the meaning\n> of the possible actions).\n> \n> So well, now the same thing happened with \"git push\", but here\n> the message actually is better and tells the reader what to do\n> (nearly); so I specified \"matching\" for the config-variable \n> push.default, and that's fine.\n> \n> I was hoping that there would also be a pull.default, which I could\n> set to matching, but apparently there is nothing like that? How\n> do I achieve this?\n> \n> It seems rather sensible to me to have this as the default: just\n> pull a matching branch, not more, not less --- what else could/should\n> it be if nothing else is specified?\n\nIs \"remote-repo\" in your case a URL or a remote config? For the latter\nyou should have remote.foo.{url,fetch} config already.\n\nThe branch.foo.{remote,merge} is set up automatically in many cases. Do\nyou have any of these?\n\nMichael\n"}]}