{"thread":{"id":"15062","subject":"[PATCH] Note the use of \"rebase -i\" to squash consecutive commits into one.","startedAt":"2008-08-17T22:32:20Z","lastAt":"2008-08-19T03:32:53Z","messageCount":2,"participants":["Eric Hanchrow","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"87501","messageId":"1219012340-23376-1-git-send-email-offby1@blarg.net","threadId":"15062","inReplyTo":null,"subject":"[PATCH] Note the use of \"rebase -i\" to squash consecutive commits into one.","fromName":"Eric Hanchrow","fromEmail":"offby1@blarg.net","sentAt":"2008-08-17T22:32:20Z","receivedAt":"2008-08-17T22:32:20Z","isPatch":true,"sender":{"key":"eric.hanchrow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3145?v=4"},"body":"---\n Documentation/git-rebase.txt |   24 +++++++++++++++++++++++-\n 1 files changed, 23 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 59c1b02..074f38b 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -341,7 +341,29 @@ was HEAD~4 becomes the new HEAD. To achieve that, you would call\n $ git rebase -i HEAD~5\n ----------------------\n \n-And move the first patch to the end of the list.\n+And move the first patch to the end of the list.  Similarly, you can\n+squash a bunch of consecutive commits into one commit.  If you start\n+with this:\n+\n+------------\n+    Q---R---S---T---U master\n+------------\n+\n+then the command\n+\n+----------------------\n+$ git rebase -i HEAD~3\n+----------------------\n+\n+would let you edit the last three commits -- S, T, and U; if you\n+edit the lines corresponding to T and U by changing \"pick\" to\n+\"squash\", the result will be\n+\n+------------\n+    Q---R---S' master\n+------------\n+\n+where S' contains all the changes that were in S, T, and U.\n \n You might want to preserve merges, if you have a history like this:\n \n-- \n1.6.0.rc3.6.gf8030\n"},{"id":"87640","messageId":"7vtzdhisre.fsf@gitster.siamese.dyndns.org","threadId":"15062","inReplyTo":"1219012340-23376-1-git-send-email-offby1@blarg.net","subject":"Re: [PATCH] Note the use of \"rebase -i\" to squash consecutive commits into one.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-19T03:32:53Z","receivedAt":"2008-08-19T03:32:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is missing sign-off.\n\nMore importantly, I do not think adding an extra illustration that starts\ntalking about an example history that is _different_ from what was being\ndiscussed is a good idea.  The end result lacks coherence and forces the\nreader to reset his mind for each example.\n\nI'd suggest you to rewrite the example part that begins a few lines before\nyou touched.  Present the example \"original\" history with illustration\nfirst (and call it A---B---C---D---E---F---G, not QRSTU), and clarify the\nexisting example of reordering the last 5 commits, and show the history\nafter such reordering.\n\nThen you talk about squashing, with before-and-after illustrations, but\nbase that illustration on the same example history.  That way, the reader\nhas to understand the original scene only once to grok both examples.\n"}]}