Squash Recent Commits Without Rebasing

suggest change

If you want to squash the previous x commits into a single one, you can use the following commands:

git reset --soft HEAD~x
git commit

Replacing x with the number of previous commits you want to be included in the squashed commit.

Mind that this will create a new commit, essentially forgetting information about the previous x commits including their author, message and date. You probably want to first copy-paste an existing commit message.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents