Skip to content

Instantly share code, notes, and snippets.

@svaksha
Forked from tuxfight3r/git-squash
Created July 14, 2021 13:58
Show Gist options
  • Select an option

  • Save svaksha/7cf4d9f32647daf1e77d8de2cd4d0045 to your computer and use it in GitHub Desktop.

Select an option

Save svaksha/7cf4d9f32647daf1e77d8de2cd4d0045 to your computer and use it in GitHub Desktop.

Revisions

  1. @tuxfight3r tuxfight3r created this gist Jul 7, 2015.
    20 changes: 20 additions & 0 deletions git-squash
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    git rebase --interactive HEAD~2

    # we are going to squash c into b
    pick b76d157 b
    pick a931ac7 c

    # squash c into b
    pick b76d157 b
    s a931ac7 c

    # after that just edit the commit message

    # This is a combination of 2 commits.
    # The first commit's message is:

    b

    # This is the 2nd commit message:

    c