Skip to content

Instantly share code, notes, and snippets.

@mattrobertsky
Created July 16, 2020 10:39
Show Gist options
  • Save mattrobertsky/2072b0a1ab81e824a6a5d38240e20b46 to your computer and use it in GitHub Desktop.
Save mattrobertsky/2072b0a1ab81e824a6a5d38240e20b46 to your computer and use it in GitHub Desktop.
git rebase --exec 'git commit --amend --no-edit -n -S' -i <previous-commit>
make a branch from your branch with unsigned commits (git checkout -b ...)
use git log --show-signature to see which are not signed
use the commit BEFORE the first one you want to fix in the above command (as <previous-commit>)
accept the generated file (don't change it)
save the file
use git log --show-signature to show the commits are now signed
push up
@gavinuhma
Copy link

Thanks!

@dscotese
Copy link

dscotese commented Apr 13, 2023

I tried this and it fails with "error: gpg failed to sign the data", I think because gpg needs the passphrase, and it's not interactive.

I found the solution to this at https://gist.github.com/paolocarrasco/18ca8fe6e63490ae1be23e84a7039374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment