- Install/Update 1Password desktop app.
- Enable the 1Password SSH Agent in Settings > Developer > SSH Agent.
- Update Git to version 2.34.0 or later.
Before starting, ensure 1Password is acting as your SSH key manager.
- Open 1Password and go to Settings > Developer.
- Check the box for Use the SSH Agent.
- (Optional but recommended) Check "Display key names when authorizing connections."
- Open your browser and log in to github.com.
- Go to the GitHub SSH and GPG keys settings.
- Click New SSH Key button.
- Click the Key text box. Click the 1Password icon, select Create SSH Key, fill in a title ("GitHub Signing Key"), and click Create and Fill.
- In the
Key typedropdown, Select Signing Key (mandatory!). - Click Add SSH Key to save it to GitHub.
Run the following commands in your terminal to configure Git to use your new 1Password key for signing. NEW_SIGNING_KEY_SSH_PUBLIC_KEY is the public ssh key of the new signing key.
- Configure the signing program:
git config --global gpg.format ssh
git config --global user.signingkey "NEW_SIGNING_KEY_SSH_PUBLIC_KEY"
# Or, if using op-ssh-sign:
#git config --global gpg.ssh.program /Applications/1Password.app/Contents/MacOS/op-ssh-sign # macOS- Enable auto-signing for all commits:
git config --global commit.gpgsign true-
Create a commit to test the signing:
git commit -S -m "Test signed commit"
You should be prompted by 1Password (via biometrics or password) to authorize the signature. Confirm the signature on GitHub by checking your commit history.