commit you can use
--fixup <commitid> or
--squash <commitid> to create a commit that can be automatically fixup’d or squashed on the next
--autosquash. This is handy, but you need to know the
There is a type of
refspec that can resolve a regular expression to the
commitid of a matching commit:
:/<RegExp>. This will find the ID of the most recent commit (not necessarily on your current branch) with message matching
/<RegExp>/, and resolve to that.
It’s a killer feature with
--squash: in a pinch, you can create fixes to past commits that
- you only vaguely remember the message of, and
- Git can automatically move (autosquash) in the next interactive rebase.
git commit --fixup ":/hat feat" may create a
!fixup That feature commit. The
!fixup prefix is what
--autosquash uses to reorder commits.
Here’s a quick video example.