{"thread":{"id":"9015","subject":"Lump commit HOWTO?","startedAt":"2007-07-13T01:21:17Z","lastAt":"2007-07-13T13:43:15Z","messageCount":4,"participants":["Josh Boyer","Alex Riesen","martin f krafft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"47224","messageId":"625fc13d0707121821l70e2d6aaw555c79b5d700585f@mail.gmail.com","threadId":"9015","inReplyTo":null,"subject":"Lump commit HOWTO?","fromName":"Josh Boyer","fromEmail":"jwboyer@gmail.com","sentAt":"2007-07-13T01:21:17Z","receivedAt":"2007-07-13T01:21:17Z","isPatch":false,"sender":{"key":"jwboyer@gmail.com","avatar":null},"body":"Hi All,\n\nI have a specific workflow in mind that I'm not entirely sure how to\naccomplish with git.  What I'd like to do is track a project in a\nlocal branch, and do commits of my own there as well.  Then when I'm\nready to submit the work, I want to take all the incremental commits\nand lump them into a single new commit and push that out as a patch or\ninto a branch for people to pull from.\n\nE.g.\n\n1) clone upstream into foo branch\n2) commit A\n3) commit B\n4) pull upstream changes into foo branch\n5) commit C\n6) commit D\n7) repeat steps 2 - 6 in various orders\n8) take all local commits (A - D) and create a single commit without\nany of the upstream changes in it\n\nIs something like that easily accomplished?  Or perhaps a different\nworkflow that would allow similar results?\n\njosh\n"},{"id":"47231","messageId":"20070713045447.GA2430@steel.home","threadId":"9015","inReplyTo":"625fc13d0707121821l70e2d6aaw555c79b5d700585f@mail.gmail.com","subject":"Re: Lump commit HOWTO?","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-13T04:54:47Z","receivedAt":"2007-07-13T04:54:47Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Josh Boyer, Fri, Jul 13, 2007 03:21:17 +0200:\n> Hi All,\n> \n> I have a specific workflow in mind that I'm not entirely sure how to\n> accomplish with git.  What I'd like to do is track a project in a\n> local branch, and do commits of my own there as well.  Then when I'm\n> ready to submit the work, I want to take all the incremental commits\n> and lump them into a single new commit and push that out as a patch or\n> into a branch for people to pull from.\n\nSee git merge --squash. It is exactly that.\nAlso git-rebase --interactive and git cherry-pick -n can help you to\nget the same.\n"},{"id":"47236","messageId":"20070713060909.GA18442@lapse.madduck.net","threadId":"9015","inReplyTo":"625fc13d0707121821l70e2d6aaw555c79b5d700585f@mail.gmail.com","subject":"Re: Lump commit HOWTO?","fromName":"martin f krafft","fromEmail":"madduck@madduck.net","sentAt":"2007-07-13T06:09:09Z","receivedAt":"2007-07-13T06:09:09Z","isPatch":false,"sender":{"key":"madduck@madduck.net","avatar":null},"body":"also sprach Josh Boyer <jwboyer@gmail.com> [2007.07.13.0321 +0200]:\n> 8) take all local commits (A - D) and create a single commit without\n> any of the upstream changes in it\n\nThis is entirely untested and since I am a newbie, it might well not\nwork, but shouldn't the following do what you want?\n\ngit log origin..master --> gives you the local commits not in origin\ngit checkout -b merger\ngit merge --squash <sha> <sha> <sha> ...\ngit commit ...\n\n-- \nmartin;              (greetings from the heart of the sun.)\n  \\____ echo mailto: !#^.\"<*>\"|tr \"<*> mailto:\" net@madduck\n \nspamtraps: madduck.bogus@madduck.net\n \nofficer, arrest that man! he's whistling a copyrighted song.\n"},{"id":"47265","messageId":"625fc13d0707130643v1fb739bejb894648dcf16bd3@mail.gmail.com","threadId":"9015","inReplyTo":"20070713045447.GA2430@steel.home","subject":"Re: Lump commit HOWTO?","fromName":"Josh Boyer","fromEmail":"jwboyer@gmail.com","sentAt":"2007-07-13T13:43:15Z","receivedAt":"2007-07-13T13:43:15Z","isPatch":false,"sender":{"key":"jwboyer@gmail.com","avatar":null},"body":"On 7/12/07, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Josh Boyer, Fri, Jul 13, 2007 03:21:17 +0200:\n> > Hi All,\n> >\n> > I have a specific workflow in mind that I'm not entirely sure how to\n> > accomplish with git.  What I'd like to do is track a project in a\n> > local branch, and do commits of my own there as well.  Then when I'm\n> > ready to submit the work, I want to take all the incremental commits\n> > and lump them into a single new commit and push that out as a patch or\n> > into a branch for people to pull from.\n>\n> See git merge --squash. It is exactly that.\n\nHm, OK.  I'll have to play with that.\n\n> Also git-rebase --interactive and git cherry-pick -n can help you to\n> get the same.\n\nGah... I totally missed git rebase.  Looks massively useful.  Thanks!\n\njosh\n"}]}