The stuff I do

Fixing commits in git

← Notes

Tags: [git][commit]

This link is dope
(And someone made a better UI here)

TODO: Extract the ones I need but can never remember

Remove commit from history 🔗

Reminder on zsh escape ^ in HEAD^ with HEAD\^

Remove the last commit from history but keep the working tree

git reset HEAD^

Remove the last commit of the history completely and discard changes

git reset --hard HEAD^ # THIS DISCARDS CHANGES

Sign an older commit in your branch 🔗

This will do an interactive rebase, playing git commit --amend --no-edit -n -S
after each commit

(Check if -n is useful I can't find it in the man)

git rebase --exec 'git commit --amend --no-edit -n -S' -i my-branch

← Notes