Skip to content

Instantly share code, notes, and snippets.

@davidrothera
Forked from qdequele/gpg_resign.sh
Created December 28, 2020 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidrothera/b047feb298def1fd31e0a3987be57b96 to your computer and use it in GitHub Desktop.
Save davidrothera/b047feb298def1fd31e0a3987be57b96 to your computer and use it in GitHub Desktop.
Resign all my old commits with GPG key
#!/bin/sh
cd $1
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "your@email.com" ]
then
git commit-tree -S "$@";
fi
' --tag-name-filter cat -- --all
git push origin master --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment