{"thread":{"id":"24519","subject":"git pull question","startedAt":"2010-07-26T01:56:17Z","lastAt":"2010-07-26T03:51:01Z","messageCount":3,"participants":["Geoff Russell","Bradley Wagner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146337","messageId":"AANLkTimHg2wtNj2BmJKJfoisoqNEExC=jNU5wB95Bsre@mail.gmail.com","threadId":"24519","inReplyTo":null,"subject":"git pull question","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2010-07-26T01:56:17Z","receivedAt":"2010-07-26T01:56:17Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"Hi,\n\nAssuming I already have a branch called brA\n\n$ git checkout master\n$ git pull origin refs/heads/brA:brA\n\nThe pull here seems to update both the current branch as well as brA?\nIs this intentional?\n\nCheers,\nGeoff.\n\nPS. git is at 1.6.2.3\n\n-- \n6 Fifth Ave,\nSt Morris, S.A. 5068\nAustralia\nPh: 041 8805 184 / 08 8332 5069\nhttp://perfidy.com.au\n"},{"id":"146339","messageId":"AANLkTi=wXGBMUekUhtHS1KCOhjgac3ET8rmSCwUPHzQ3@mail.gmail.com","threadId":"24519","inReplyTo":"AANLkTimHg2wtNj2BmJKJfoisoqNEExC=jNU5wB95Bsre@mail.gmail.com","subject":"Re: git pull question","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-26T03:43:31Z","receivedAt":"2010-07-26T03:43:31Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"> Hi,\n>\n> Assuming I already have a branch called brA\n>\n> $ git checkout master\n> $ git pull origin refs/heads/brA:brA\n>\n> The pull here seems to update both the current branch as well as brA?\n> Is this intentional?\n\nI believe this is intentional.\n\nA git pull always pulls into (at least) the currently checked out\nbranch, in your case \"master\". By adding the <dst> param after the\ncolon in the <refspec> you're saying to go ahead and fast-forward\nmerge the local branch called \"brA\" if possible.\n\nThis is almost equivalent to saying:\n\ngit checkout brA\ngit pull origin brA\ngit checkout master\ngit pull origin brA\n\nassuming everything can be fast-forward merged.\n\nRead the the portion of git-pull man entry regarding the <refspec> for\na more thorough explanation:\nhttp://www.kernel.org/pub/software/scm/git/docs/git-pull.html\n\nHowever, I'm not entirely clear myself on the meaning of this note in\nthe documentation:\n\nNote\nYou never do your own development on branches that appear on the right\nhand side of a <refspec> colon on Pull: lines; they are to be updated\nby git fetch. If you intend to do development derived from a remote\nbranch B, have a Pull: line to track it (i.e.  Pull: B:remote-B), and\nhave a separate branch my-B to do your development on top of it. The\nlatter is created by git branch my-B remote-B (or its equivalent git\ncheckout -b my-B remote-B). Run git fetch to keep track of the\nprogress of the remote side, and when you see something new on the\nremote branch, merge it into your development branch with git pull .\nremote-B, while you are on my-B branch.\n\n>\n> Cheers,\n> Geoff.\n>\n> PS. git is at 1.6.2.3\n>\n> --\n> 6 Fifth Ave,\n> St Morris, S.A. 5068\n> Australia\n> Ph: 041 8805 184 / 08 8332 5069\n> http://perfidy.com.au\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"146340","messageId":"AANLkTikpspDiUf==vCUiBqnQKFgcbag8XXaNYK3COjQu@mail.gmail.com","threadId":"24519","inReplyTo":"AANLkTi=wXGBMUekUhtHS1KCOhjgac3ET8rmSCwUPHzQ3@mail.gmail.com","subject":"Re: git pull question","fromName":"Geoff Russell","fromEmail":"geoffrey.russell@gmail.com","sentAt":"2010-07-26T03:51:01Z","receivedAt":"2010-07-26T03:51:01Z","isPatch":false,"sender":{"key":"geoffrey.russell@gmail.com","avatar":"https://gravatar.com/avatar/c30f497ccfa6bf06d86f30bd2ba092a2dd124c61c6bc902f7cb5c3f6486947de?d=mp&s=160"},"body":"On Mon, Jul 26, 2010 at 1:13 PM, Bradley Wagner\n<bradley.wagner@hannonhill.com> wrote:\n>> ...\n>> $ git checkout master\n>> $ git pull origin refs/heads/brA:brA\n>>\n>> The pull here seems to update both the current branch as well as brA?\n>> Is this intentional?\n>\n> I believe this is intentional.\n>\n> A git pull always pulls into (at least) the currently checked out\n> branch, in your case \"master\". By adding the <dst> param after the\n> colon in the <refspec> you're saying to go ahead and fast-forward\n> merge the local branch called \"brA\" if possible.\n\nOkay.\n\n\n> However, I'm not entirely clear myself on the meaning of this note in\n> the documentation:\n>\n> Note\n> You never do your own development on branches that appear on the right\n> hand side of a <refspec> colon on Pull: lines; they are to be updated\n> by git fetch. If you intend to do development derived from a remote\n> branch B, have a Pull: line to track it (i.e.  Pull: B:remote-B), and\n> have a separate branch my-B to do your development on top of it. The\n> latter is created by git branch my-B remote-B (or its equivalent git\n> checkout -b my-B remote-B). Run git fetch to keep track of the\n> progress of the remote side, and when you see something new on the\n> remote branch, merge it into your development branch with git pull .\n> remote-B, while you are on my-B branch.\n\nYes, I was wondering about this ... I can't see any downside\n\n\nGeoff.\n"}]}