# Signing Git Commits With SSH Keys
In order to sign git commits with SSH keys you need Git v2.34. To enable it to work with 1Password automatically you need to set the following config values.
```ini
[user]
signingkey = ssh-ed25519 AAAAC3...
[gpg]
format = ssh
[gpg "ssh"]
#Skip this if you're not using 1P
program = "C:/Users/milekic/AppData/Local/1Password/app/8/op-ssh-sign.exe"
[commit]
gpgsign = true
```
- If you're using 1Password integration you can view all used keys using `ssh-add -l` but only if you set the `SSH_AUTH_SOCK` environment variable like
- `export SSH_AUTH_SOCK=~/.1password/agent.sock`
- This won't work for GUI applications in MacOS. The solution is to add a launch agent instead. See [[Setting Environment Variables on MacOS]] for more info. For a snippet see [[#`SSH_AUTH_SOCK` for GUI applications]]
- 1Password should automatically edit your `.ssh/config` to set your `IdentityAgent` and `ForwardAgent` but it's worth checking to make sure.
- `ForwardAgent` is used to allow you to sign commits even via a remote machine over SSH
```
Host *
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
ForwardAgent yes
```
## `SSH_AUTH_SOCK` for GUI applications
```shell
cat << EOF > ~/Library/LaunchAgents/com.1password.SSH_AUTH_SOCK.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.1password.SSH_AUTH_SOCK</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>/bin/ln -sf $HOME/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock \$SSH_AUTH_SOCK</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF
launchctl load -w ~/Library/LaunchAgents/com.1password.SSH_AUTH_SOCK.plist
```
## Sources
- [Signing Git Commits with Your SSH Key](https://calebhearth.com/sign-git-with-ssh)
- [Sign Git commits with SSH](https://developer.1password.com/docs/ssh/git-commit-signing/)
- [SSH client compatibility](https://developer.1password.com/docs/ssh/agent/compatibility/)
- [Using 1password, GPG and git for seamless commits signing](https://bmaingret.github.io/blog/2022-02-15-1Password-gpg-git-seamless-commits-signing)