↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Don't Amend, Fix

The post recommends avoiding git commit --amend for routine fixes. It says amend hides history and breaks down when the fix belongs earlier in a branch, where git rebase is needed instead.

It then proposes git commit --fixup together with git rebase -i --autosquash as a lower-friction workflow. The suggested aliases are ri, mri, fix, and squ, and the author says this approach lets you keep making fixup commits until the rebase.

Reading notes
#

  • git commit --amend can hide the previous state and should stay a last resort.
  • When a forgotten change belongs to an earlier commit, the workflow moves to git rebase -i.
  • git commit --fixup and git rebase -i --autosquash remove the need to reorder commits and edit pick lines manually.
  • The suggested aliases are ri = rebase -i --autosquash, mri = rebase -i, fix = commit --fixup, and squ = commit --squash.
  • Multiple fixup commits can be stacked before rebasing, and autosquash still groups them correctly.