Skip to content

Instantly share code, notes, and snippets.

@klan
Created August 10, 2026 12:17
Show Gist options
  • Select an option

  • Save klan/9cffdac3c48dd4f12a79ff473fa9db3c to your computer and use it in GitHub Desktop.

Select an option

Save klan/9cffdac3c48dd4f12a79ff473fa9db3c to your computer and use it in GitHub Desktop.
git rebase

How to alter commit message on multiple commits and push it again:

git rebase -i HEAD~2
  • Replace pick with edit OR reword
  • Go through all commits and update commit message

With commits pushed to remote:

git push ---force

OR

git push --force-with-lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment