Skip to content

config instructions for commit signing with ssh keys #45261

Description

@GrumpyOldTroll

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key

What part(s) of the article would you like to see updated?

When I use the path to my public key, my commits are unverified.

So this config has broken behavior for me:

git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB

When I changed it to use the contents of the public key file, my signatures became verified as long as the private key was added to the ssh-agent with ssh-add.

So using this config instead of the above fixed the instructions for me:

git config --global user.signingkey "$(cat /PATH/TO/.SSH/KEY.PUB)"
ssh-add /PATH/TO/.SSH/KEY

Also useful here would be an explanation (if the feature exists?) that describes how to cause a visible warning or error if commit-signing is enabled but a particular signing of a commit was unsuccessful.

Additional information

This is on an up-to-date macbook, in case it matters. I haven't verified the same problem on other platforms.

git --version
git version 2.50.1 (Apple Git-155)

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamtriageDo not begin working on this issue until triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions