Skip to content

Comments

Fix SSH commit signing when host uses 1Password#25

Open
DarkaMaul wants to merge 1 commit intomainfrom
fix/ssh-commit-signing
Open

Fix SSH commit signing when host uses 1Password#25
DarkaMaul wants to merge 1 commit intomainfrom
fix/ssh-commit-signing

Conversation

@DarkaMaul
Copy link
Contributor

Summary

  • Override gpg.ssh.program in the container's .gitconfig.local to use /usr/bin/ssh-keygen instead of whatever the host has configured
  • Fixes commit signing failure when the host sets this to 1Password's op-ssh-sign binary, which doesn't exist inside the container
  • Works because DevContainers automatically forward SSH_AUTH_SOCK, so the host's SSH agent (including 1Password's) is already accessible — only the signing program path needs to differ

Test plan

  • Build devcontainer with a host .gitconfig that sets gpg.ssh.program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
  • Verify git commit -S succeeds inside the container using the forwarded SSH agent
  • Verify the override appears after the [include] directive in ~/.gitconfig.local

🤖 Generated with Claude Code

When the host configures `gpg.ssh.program` to use 1Password's
`op-ssh-sign` binary, commit signing fails inside the container
because that macOS-specific binary doesn't exist.

DevContainers automatically forward SSH_AUTH_SOCK from the host,
so the SSH agent (including 1Password's) is already available.
By overriding `gpg.ssh.program` to `/usr/bin/ssh-keygen` in the
container's local gitconfig (which is included after the host
config), signing uses the standard ssh-keygen against the
forwarded agent instead of the missing 1Password binary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant