4

Github gives the possibility to verify commits by signing them with GPG.

After you do this, you get all your commits verified/signed. But, I have pushed commits before doing this. Is there a way to verify/sign those commits?

Sebastian D'Agostino
  • 1,575
  • 2
  • 27
  • 44

1 Answers1

4

That would involve rewriting the history of your repository, either with:

  • git rebase -i, with an edit and git commit -S --amend --no-edit on each commit
  • or a git filter-branch.

Something like this answer, but using any criteria you want:

git filter-branch --commit-filter 'if [ <some criteria> ];
  then git commit-tree -S "$@";
  else git commit-tree "$@";
  fi' HEAD
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250