docs icon indicating copy to clipboard operation
docs copied to clipboard

"Telling Git about your SSH key" advises signing with a public key

Open rmoreyunderline opened this issue 7 months ago • 4 comments

Issue: "Telling Git about your SSH key" advises signing with a public key. However, signing should occur with a private key.

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

Image

Suggested change: Change instances of /PATH/TO/.SSH/KEY.PUB to /PATH/TO/.SSH/KEY. Clarify plainly that the private key is used ~and that signing with a public key will likely result in an error~.

rmoreyunderline avatar Jun 04 '25 03:06 rmoreyunderline

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Jun 04 '25 03:06 welcome[bot]

Thanks for opening this issue! That seems like a major oversight, so I'll definitely look into it.

Sharra-writes avatar Jun 04 '25 22:06 Sharra-writes

@rmoreyunderline To clarify, you say "likely result in an error." Have you tried these steps and received an error?

Sharra-writes avatar Jun 04 '25 22:06 Sharra-writes

I've tried both cases now: specifying the public key for signing, and specifying the private key. It seems that both actually result in commit signing. This means that Git knows to use the private key even if the public key is specified.

The Git docs mention that a signing key can be specified after getting a private key (for GPG which is also asymmetric): https://git-scm.com/book/ms/v2/Git-Tools-Signing-Your-Work

Once you have a private key to sign with...

Technically the private key is used to sign. Testing reveals that Git allows either key to be specified even though only the private key is used. So this ticket becomes more a question of which filename is preferred. This ticket is thus not urgent and may benefit from additional feedback.

rmoreyunderline avatar Jun 05 '25 01:06 rmoreyunderline

A stale label has been added to this issue and it has been closed, because it has been open for 30 days with no activity. If you think this issue should remain open, please add a new comment.

github-actions[bot] avatar Jul 07 '25 16:07 github-actions[bot]