Skip to content

Instantly share code, notes, and snippets.

@ycombinator
Last active April 5, 2016 19:24
Show Gist options
  • Select an option

  • Save ycombinator/1854bf9f53ce1765375a8636373a44ad to your computer and use it in GitHub Desktop.

Select an option

Save ycombinator/1854bf9f53ce1765375a8636373a44ad to your computer and use it in GitHub Desktop.
Setting up gpg-agent with git on Mac
  1. Install gpg-agent
$ brew install gpg-agent
  1. You'll want to start gpg-agent each time a shell is opened. Add the following lines to your ~/.profile or equivalent:
GPG_TTY=$(tty)
export GPG_TTY
eval $(gpg-agent --daemon --allow-preset-passphrase)
  1. Edit the ~/.gnupg/gpg.conf file and uncomment the use-agent line.
  2. Open a new shell (so new settings take effect).
  3. Run git commit -S .... The first time you'll be prompted for your GPG passphrase but it will be saved by the agent thereafter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment