{"thread":{"id":"24527","subject":"Merge commit before branch tip","startedAt":"2010-07-26T15:38:04Z","lastAt":"2010-07-26T16:15:02Z","messageCount":4,"participants":["Bradley Wagner","Jonathan Nieder","Eugene Sajine","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"146384","messageId":"AANLkTikp5dHz97qp3pf+DE-wABNVYTGAQ+h30D9Fa04c@mail.gmail.com","threadId":"24527","inReplyTo":null,"subject":"Merge commit before branch tip","fromName":"Bradley Wagner","fromEmail":"bradley.wagner@hannonhill.com","sentAt":"2010-07-26T15:38:04Z","receivedAt":"2010-07-26T15:38:04Z","isPatch":false,"sender":{"key":"bradley.wagner@hannonhill.com","avatar":"https://gravatar.com/avatar/8304e5020b13d5f8102220fae2f5dd607a2e114dbe62bbd92c1ab38fe0b69fdb?d=mp&s=160"},"body":"I realize this is not a best practice but is it possible to merge a\nbranch but at a point before the branch tip?\n\nThis came up recently for us. There are 9 new commits in our stable\nbranch that need to be merged back into \"master\". However, there is 1\ncommit (the branch tip) that we're not all that happy with and don't\nwant to merge into the \"master\".\n\nIdeally, I'd like them to show up as a merge rather than a cherry-pick\nbasically as if I'd done the merge before that latest commit was made.\n"},{"id":"146388","messageId":"20100726160620.GA4399@burratino","threadId":"24527","inReplyTo":"AANLkTikp5dHz97qp3pf+DE-wABNVYTGAQ+h30D9Fa04c@mail.gmail.com","subject":"Re: Merge commit before branch tip","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-26T16:06:20Z","receivedAt":"2010-07-26T16:06:20Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Bradley,\n\nBradley Wagner wrote:\n\n> I realize this is not a best practice but is it possible to merge a\n> branch but at a point before the branch tip?\n\nI do not even think it is not a best practice.  You can do\n\n  $ git fetch --all\n  $ git merge origin/master~1\n\nand git will happily create a merge with message\n\n  Merge remote branch 'origin/master' (early part)\n\n(See the \"SPECIFYING REVISIONS\" section of git-rev-parse(1)\nfor more examples.)\n\nHope that helps,\nJonathan\n"},{"id":"146389","messageId":"AANLkTi=dOpWKAg9vH6sR2Xdi1XitD6vOx6Pd8Nt3A2bJ@mail.gmail.com","threadId":"24527","inReplyTo":"AANLkTikp5dHz97qp3pf+DE-wABNVYTGAQ+h30D9Fa04c@mail.gmail.com","subject":"Re: Merge commit before branch tip","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-07-26T16:08:44Z","receivedAt":"2010-07-26T16:08:44Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Mon, Jul 26, 2010 at 11:38 AM, Bradley Wagner\n<bradley.wagner@hannonhill.com> wrote:\n> I realize this is not a best practice but is it possible to merge a\n> branch but at a point before the branch tip?\n>\n> This came up recently for us. There are 9 new commits in our stable\n> branch that need to be merged back into \"master\". However, there is 1\n> commit (the branch tip) that we're not all that happy with and don't\n> want to merge into the \"master\".\n>\n> Ideally, I'd like them to show up as a merge rather than a cherry-pick\n> basically as if I'd done the merge before that latest commit was made.\n\nIsn't the following giving you what you need?\n\n$ git co master\n$ git merge stable~1\n\n?\n\nThanks,\nEugene\n"},{"id":"146390","messageId":"vpqy6cyw77d.fsf@bauges.imag.fr","threadId":"24527","inReplyTo":"20100726160620.GA4399@burratino","subject":"Re: Merge commit before branch tip","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-07-26T16:15:02Z","receivedAt":"2010-07-26T16:15:02Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Hi Bradley,\n>\n> Bradley Wagner wrote:\n>\n>> I realize this is not a best practice but is it possible to merge a\n>> branch but at a point before the branch tip?\n>\n> I do not even think it is not a best practice.  You can do\n>\n>   $ git fetch --all\n>   $ git merge origin/master~1\n\n... or whatever commit identifier indeed:\n\n   $ git merge 64fdc08da\n\nis fine too, but you have to find out the 64fdc08da part (using git\nlog for example).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}