Git Combine Commits

If you have a bunch of commits and need to put them in a single one. Then performing a rebase can help clean up the git log.

Enter the following command

git rebase -i HEAD~{commits to combine}

In the message, set the commits that should be combined to squash.

Final do a force push (git push origin -f {branch name})

Leave a Reply

Your email address will not be published. Required fields are marked *