Skip to content

Instantly share code, notes, and snippets.

@GlitchedPolygons
Forked from mort3za/git-auto-sign-commits.sh
Last active April 2, 2019 22:37
Show Gist options
  • Save GlitchedPolygons/89ad2281ebe1dedda6779eccaa485381 to your computer and use it in GitHub Desktop.
Save GlitchedPolygons/89ad2281ebe1dedda6779eccaa485381 to your computer and use it in GitHub Desktop.
Auto sign your git commits
# Generate a new pgp key:
gpg --full-generate-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# Check current keys:
gpg --list-secret-keys --keyid-format LONG
# Export public key in gpg:
gpg --armor --export ER34512P9
# Your key id is the HASH in front of `sec` in previous command - looks a bit like "ER34512P9" or something like that.
# Set a pgp key for git:
git config --global user.signingkey ER34512P9
# To sign a single commit:
git commit -S -a -m "Test a signed commit"
# Auto-sign all your commits globally
git config --global commit.gpgsign true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment