Skip to content
The Git Crypt

/static/cripta/en/ossada/commit-fixup/

Menu

GIT-022 · Surgery

git commit --fixup

Tags the patch with its target's name; autosquash slots it in later.

Found a mistake in a commit three back? --fixup=<hash> creates a commit whose message is fixup! plus the target's title — a labeled patch, waiting for the stitching.

The stitching is git rebase -i --autosquash: git reads the labels, drags each patch under its target and melds it without ceremony. The series comes out clean, as if the mistake never existed — cosmetic surgery on history, by appointment.

$ git commit --fixup=9c2d4e1
[main 4e8f2a1] fixup! helpers: extrai fatiaTitulo
$ git rebase -i --autosquash 9c2d4e1~1
Successfully rebased and updated refs/heads/main.
The labeled patch, stitched into its proper place.