Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.03 KB

File metadata and controls

35 lines (23 loc) · 1.03 KB

Using fixup commits

When you address review feedback, add fixup commits instead of rewriting the commits a reviewer has already read. The reviewer then sees only what changed since their last pass, and the history is cleaned up just before merge.

Making a fixup commit

Point the fixup at the commit it belongs to:

git add <files>
git commit --fixup <sha>   # or --fixup HEAD for the latest commit
git push

The commit is named fixup! <original header>. The commit message checks skip these commits.

Before merge

Pull requests are squash merged, so fixup commits disappear on main. If a maintainer asks you to clean up the branch first, fold the fixups into their targets and force-push:

git rebase -i --autosquash main
git push --force-with-lease

Rewording a commit message

If the check in CI flags a commit message, reword it:

git rebase -i main          # mark the commit as "reword"
git push --force-with-lease

Or, for the latest commit only, git commit --amend and push with --force-with-lease.