Last active
February 9, 2023 05:11
-
-
Save jhsu802701/81a8951e5bf7102a5c0fe45048427648 to your computer and use it in GitHub Desktop.
How to consolidate Git commits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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