Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to promote a fixup commit to a regular commit in Git?

I have created a fixup commit with code that I now realized should be a regular commit. I don't want to have any surprises on the next rebase - how can I make this fixup commit a regular commit, dis-associating it from the commit ID I tried to "fix"?

like image 932
chiborg Avatar asked Jun 26 '26 06:06

chiborg


1 Answers

A fixup commit (that is, one you create with git commit --fixup) or a squash commit (one you create with git commit --squash) are really just regular commits. So if you'd like to turn one of them into a regular commit, just edit its commit message.

  • if the commit is the latest in the branch, use git commit --amend,
  • if it's earlier, you can use git rebase -i (without the --autosquash option) to edit the commit message and place it where you'd like it.
like image 143
bk2204 Avatar answered Jun 28 '26 01:06

bk2204