Skip to content

Instantly share code, notes, and snippets.

@jhsu802701
Last active February 9, 2023 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhsu802701/81a8951e5bf7102a5c0fe45048427648 to your computer and use it in GitHub Desktop.
Save jhsu802701/81a8951e5bf7102a5c0fe45048427648 to your computer and use it in GitHub Desktop.
How to consolidate Git commits
https://www.internalpointers.com/post/squash-commits-into-one-git
git rebase --interactive [commit-hash]
Where [commit-hash] is the hash of the commit just before the first one you want to rewrite from.
OR
git rebase --interactive master
Shows commits in reverse order
Keep the first commit listed as "pick".
Change the other commits you wish to squash as "squash".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment