-
-
Save vitalymak/2704232fd939ffc5e44c47089e0e7e3b to your computer and use it in GitHub Desktop.
Automatic Git commit signing with GPG on OSX
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
| # Add the following to your shell init to set up gpg-agent automatically for every shell | |
| if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then | |
| source ~/.gnupg/.gpg-agent-info | |
| export GPG_AGENT_INFO | |
| else | |
| eval $(gpg-agent --daemon --write-env-file ~/.gnupg/.gpg-agent-info) | |
| fi |
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
| # Enables GPG to find gpg-agent | |
| use-standard-socket | |
| # Connects gpg-agent to the OSX keychain via the brew-installed | |
| # pinentry program from GPGtools | |
| pinentry-program /usr/local/bin/pinentry-mac |
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
| # Uncomment within config (or add this line) | |
| use-agent |
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
| brew install gnupg gpg-agent pinentry-mac | |
| # Learn about creating a GPG key and the knowledge behind these commands here: | |
| # https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work | |
| git config --global user.signingkey <YOUR-SIGNING-KEY-PUB-ID> | |
| git config --global commit.gpgsign true | |
| # Don't forget to upload your keys to Github! | |
| # https://github.com/blog/2144-gpg-signature-verification |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment