Search This Blog

Tuesday 10 December 2019

Git squash

Start with git status to check you don't have anything to commit. git reset --soft OLDEST_COMMIT_TO_INCLUDE_IN_SQUASH git commit -m 'Squashed lots of commits' git push --force origin master
This will squash all commits between OLDEST_COMMIT_TO_INCLUDE_IN_SQUASH and the LATEST commit and replace them with a single commit with the comment Squashed lots of commits This is re-writing history so avoid this if anyone else might has cloned or pulled your repo.

No comments:

Post a Comment