-
-
Save GlitchedPolygons/89ad2281ebe1dedda6779eccaa485381 to your computer and use it in GitHub Desktop.
Auto sign your git commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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