Skip to content

Instantly share code, notes, and snippets.

@diodonfrost
Last active July 21, 2021 19:35
Show Gist options
  • Select an option

  • Save diodonfrost/9ecd101ef641d349d89b3f38a0a3bf2d to your computer and use it in GitHub Desktop.

Select an option

Save diodonfrost/9ecd101ef641d349d89b3f38a0a3bf2d to your computer and use it in GitHub Desktop.
Filter only specific commits and sign only them
# Filter only specific commits and sign only them
git filter-branch --commit-filter 'if [ "$GIT_COMMITTER_EMAIL" = "user@domain.com" ];
then git commit-tree -S "$@";
else git commit-tree --no-gpg-sign "$@";
fi' HEAD
git push --force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment