Rename commits in Git
Working on large pull requests can be hard. It often is even harder to review them. A clean commit history can help reviewers out. Naming the commits consistently can help in that regard. Often it is hard to do this consistently beforehand, so sometimes it would be nice to rename commits after already committing them.
In this post I'll explain 3 methods of renaming commits:
- Rename the last commit using
git commit --amend
- Rename commits one-by-one using
git rebase
andreword
- Rename commits in batch using
git rebase
and amend
27 September 2022