{"thread":{"id":"25197","subject":"Folding commits together","startedAt":"2010-09-22T10:51:43Z","lastAt":"2010-09-22T19:25:47Z","messageCount":4,"participants":["Maaartin","Matthieu Moy","Jay Soffian"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"151287","messageId":"loom.20100922T123419-101@post.gmane.org","threadId":"25197","inReplyTo":null,"subject":"Folding commits together","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-09-22T10:51:43Z","receivedAt":"2010-09-22T10:51:43Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"I've made a couple of trivial commits I'd like to fold into a single commit now. \nIn the manpage of git-rebase I saw a recipe how to do it using rebase -i and it \nseemed quite trivial, but it doesn't work for me. I'm in a clean state on branch \nmaster and want fold the last 3 commits into one - this is probably the most \ntrivial use case. Whatever I try I get an empty .git/rebase-merge/git-rebase-\ntodo, so I can't get to the point of using <<If you want to fold two or more \ncommits into one, replace the command \"pick\" for the second and subsequent \ncommits with \"squash\" or \"fixup\".>>\n"},{"id":"151288","messageId":"vpqsk12rpz4.fsf@bauges.imag.fr","threadId":"25197","inReplyTo":"loom.20100922T123419-101@post.gmane.org","subject":"Re: Folding commits together","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-09-22T11:13:03Z","receivedAt":"2010-09-22T11:13:03Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Maaartin <grajcar1@seznam.cz> writes:\n\n> I've made a couple of trivial commits I'd like to fold into a single commit now. \n> In the manpage of git-rebase I saw a recipe how to do it using rebase -i and it \n> seemed quite trivial, but it doesn't work for me. I'm in a clean state on branch \n> master and want fold the last 3 commits into one - this is probably the most \n> trivial use case. Whatever I try I get an empty .git/rebase-merge/git-rebase-\n> todo, so I can't get to the point of using <<If you want to fold two or more \n> commits into one, replace the command \"pick\" for the second and subsequent \n> commits with \"squash\" or \"fixup\".>>\n\nWhich exact command did you type? Something like this should do it:\n\ngit rebase -i HEAD~3\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"151289","messageId":"loom.20100922T132318-104@post.gmane.org","threadId":"25197","inReplyTo":"vpqsk12rpz4.fsf@bauges.imag.fr","subject":"Re: Folding commits together","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-09-22T11:33:21Z","receivedAt":"2010-09-22T11:33:21Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"Matthieu Moy <Matthieu.Moy <at> grenoble-inp.fr> writes:\n\n> Which exact command did you type? Something like this should do it:\n> \n> git rebase -i HEAD~3\n\nI've tried nearly everything, starting with\n\ngit rebase -i d8e3842\n\nwhich should be the just the same as HEAD~3. I retract the question, my editor \nkeeps opening a wrong file, which I've just spotted by accident. The problem was \ncaused by a git-cygwin-emacsclient-emacs interaction, rebase works nicely.\n"},{"id":"151319","messageId":"AANLkTikqmJrLoF8tvpUoE7gfPOtHkFr0VMH0oqzdxani@mail.gmail.com","threadId":"25197","inReplyTo":"loom.20100922T132318-104@post.gmane.org","subject":"Re: Folding commits together","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-09-22T19:25:47Z","receivedAt":"2010-09-22T19:25:47Z","isPatch":false,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Wed, Sep 22, 2010 at 7:33 AM, Maaartin <grajcar1@seznam.cz> wrote:\n> Matthieu Moy <Matthieu.Moy <at> grenoble-inp.fr> writes:\n>\n>> Which exact command did you type? Something like this should do it:\n>>\n>> git rebase -i HEAD~3\n>\n> I've tried nearly everything, starting with\n>\n> git rebase -i d8e3842\n>\n> which should be the just the same as HEAD~3. I retract the question, my editor\n> keeps opening a wrong file, which I've just spotted by accident. The problem was\n> caused by a git-cygwin-emacsclient-emacs interaction, rebase works nicely.\n\nAnother way to do this if it's the top-most commits is:\n\n$ git reset --soft HEAD~3\n$ git commit --amend\n\nj.\n"}]}