{"thread":{"id":"19917","subject":"git pull merges current branch even when <dst> is specified","startedAt":"2009-06-24T16:47:32Z","lastAt":"2009-06-25T13:28:38Z","messageCount":4,"participants":["Tom Lambda","Michael J Gruber","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116869","messageId":"1245862052581-3149948.post@n2.nabble.com","threadId":"19917","inReplyTo":null,"subject":"git pull merges current branch even when <dst> is specified","fromName":"Tom Lambda","fromEmail":"tom.lambda@gmail.com","sentAt":"2009-06-24T16:47:32Z","receivedAt":"2009-06-24T16:47:32Z","isPatch":false,"sender":{"key":"tom.lambda@gmail.com","avatar":null},"body":"\nIf I am in 'master' and 'bugfix' is a remote branch in 'repo' which I do not\nhave locally yet, running:\n\ngit pull repo bugfix:bugfix\n\ncreates a new local branch 'bugfix' equals to 'repo/bugfix' as expected.\nHowever, it also merges 'bugfix' into 'master', that surprises me since I\nexplicitly specify that <dst> is 'bugfix'.\n\nI know that I can get what I want by running:\n\ngit fetch repo bugfix:bugfix\n\nBut the git-pull behavior looks odd to me. I thought that <dst> was the\ncurrent branch by default and it could be overridden by specifying it in the\ncommand line.\n\nThank you,\nTom\n\n-- \nView this message in context: http://n2.nabble.com/git-pull-merges-current-branch-even-when-%3Cdst%3E-is-specified-tp3149948p3149948.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"116908","messageId":"4A433AC8.4040702@drmicha.warpmail.net","threadId":"19917","inReplyTo":"1245862052581-3149948.post@n2.nabble.com","subject":"Re: git pull merges current branch even when <dst> is specified","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-06-25T08:52:24Z","receivedAt":"2009-06-25T08:52:24Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Tom Lambda venit, vidit, dixit 24.06.2009 18:47:\n> \n> If I am in 'master' and 'bugfix' is a remote branch in 'repo' which I do not\n> have locally yet, running:\n> \n> git pull repo bugfix:bugfix\n> \n> creates a new local branch 'bugfix' equals to 'repo/bugfix' as expected.\n> However, it also merges 'bugfix' into 'master', that surprises me since I\n> explicitly specify that <dst> is 'bugfix'.\n> \n> I know that I can get what I want by running:\n> \n> git fetch repo bugfix:bugfix\n> \n> But the git-pull behavior looks odd to me. I thought that <dst> was the\n> current branch by default and it could be overridden by specifying it in the\n> command line.\n\nWell, the first line of git-pull's man page says:\n\nRuns git-fetch with the given parameters, and calls git-merge to merge\nthe retrieved head(s) into the current branch.\n\nSo I can't help but call your surprise somewhat unjustified ;)\n\nMichael\n"},{"id":"116912","messageId":"alpine.DEB.1.00.0906251142550.5365@intel-tinevez-2-302","threadId":"19917","inReplyTo":"4A433AC8.4040702@drmicha.warpmail.net","subject":"Re: git pull merges current branch even when <dst> is specified","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-06-25T09:44:17Z","receivedAt":"2009-06-25T09:44:17Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 25 Jun 2009, Michael J Gruber wrote:\n\n> Tom Lambda venit, vidit, dixit 24.06.2009 18:47:\n> > \n> > If I am in 'master' and 'bugfix' is a remote branch in 'repo' which I do not\n> > have locally yet, running:\n> > \n> > git pull repo bugfix:bugfix\n> > \n> > creates a new local branch 'bugfix' equals to 'repo/bugfix' as expected.\n> > However, it also merges 'bugfix' into 'master', that surprises me since I\n> > explicitly specify that <dst> is 'bugfix'.\n> > \n> > I know that I can get what I want by running:\n> > \n> > git fetch repo bugfix:bugfix\n> > \n> > But the git-pull behavior looks odd to me. I thought that <dst> was the\n> > current branch by default and it could be overridden by specifying it in the\n> > command line.\n> \n> Well, the first line of git-pull's man page says:\n> \n> Runs git-fetch with the given parameters, and calls git-merge to merge\n> the retrieved head(s) into the current branch.\n\nTo explain why this is so: Merging is an operation that requires a working \ndirectory, as merge conflicts can happen.  That is why merging is only \npossible locally, and only into the current branch.\n\nCiao,\nDscho\n"},{"id":"116933","messageId":"1245936518805-3155010.post@n2.nabble.com","threadId":"19917","inReplyTo":"alpine.DEB.1.00.0906251142550.5365@intel-tinevez-2-302","subject":"Re: git pull merges current branch even when <dst> is specified","fromName":"Tom Lambda","fromEmail":"tom.lambda@gmail.com","sentAt":"2009-06-25T13:28:38Z","receivedAt":"2009-06-25T13:28:38Z","isPatch":false,"sender":{"key":"tom.lambda@gmail.com","avatar":null},"body":"\nThank you for the explanation.\n\nSo specifying :<dst> in git-pull does not seem that useful now to me, since\none has to checkout the <dst> branch anyway to keep other branches\nunaltered.\n\nThanks again,\nTom\n\n\nJohannes Schindelin wrote:\n> \n> \n> To explain why this is so: Merging is an operation that requires a working \n> directory, as merge conflicts can happen.  That is why merging is only \n> possible locally, and only into the current branch.\n> \n> \n\n-- \nView this message in context: http://n2.nabble.com/git-pull-merges-current-branch-even-when-%3Cdst%3E-is-specified-tp3149948p3155010.html\nSent from the git mailing list archive at Nabble.com.\n"}]}