The stuff I do

Fixing commits in git

← Notes

Tags: [git][commit]

This link is dope https://sethrobertson.github.io/GitFixUm/fixup.html

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 of the history completely and discard changes

git reset --hard HEAD^

Remove the last commit from history but keep the working tree

git reset HEAD^

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