Signing key with TortoiseGit and GitHub #23205
-
When I commit/push to my projects using TortoiseGit and my GitHub credentials, the commits are not attributed to my GitHub profile. I guess this is because I have not set up a signing key with TortoiseGit? (I assumed that my GitHub username and password would suffice to identify me but apparently this ist not the case…) So I wanted to set up a key but I got confused. Under TortoiseGit you can setup a Putty Key (.ppk) for each repository: But when I create a keypair with puttygen.exe, the public key starts with ---- BEGIN SSH2 PUBLIC KEY ---- and github will not accept this when I try to add a new SSH key: On the other hand, when I generate a key pair as described on the GitHub Page with
I get a key pair, whose public key is accepted by GitHub, but the private key is not a .pkk file, so I guess it would not be accepted by TortoiseGit as a “Putty Key” (did not try)? How is this done the right way? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
A signing key won’t help associate commits with your GitHub account. What you need to do is set your user name and email address, and the email address must match one of the email addresses that you have configured for your GitHub account. See the GitHub help documentation and the Support Protips article Why is my commit associated with the wrong person? for further information. |
Beta Was this translation helpful? Give feedback.
-
I had this same problem with the SSH keys. The original post is asking about commit attribution and the solution posted seems to address that. However, I’d like to know if there is a solution to the SSH key problem itself. Is there a way to use SSH with TortoiseGIT and GitHub without having these key conflicts? Thanks much for any advice anyone has! |
Beta Was this translation helpful? Give feedback.
-
Related question when trying to push to Github with TortioseGit. I have copied my public SSH into my Github account. And within TortioseGit I point to my SSH key. However, what is the Github URL supposed to be??? Please provide an example. This doesn’t work… ssh://[email protected]:>/Repository.git |
Beta Was this translation helpful? Give feedback.
-
The scheme is |
Beta Was this translation helpful? Give feedback.
-
I'm sure this is a no-no to resurrect an old thread, but I'm having essentially the same issue. Commits do not show up as Verified on Github when committing using TortoiseGit. If I commit from the command line it works. My username and email is set correctly in Github and TortoiseGit. Viewing the effective config from TortoiseGit everything seems fine. I have a user.signingkey and it is set to ssh. Like I mentioned from the command line it works just fine. Just can't figure out what needs set from the TortoiseGit side to get this working. |
Beta Was this translation helpful? Give feedback.
-
So I kind of feel bad to Necro this discussion again. But seeing as I didn't actually see a functional resolution listed yet, and I just came across this page, and I did finally get it working. I thought I would share. So from the original answer, you would need the email and such in Tortoise to match GitHub. From there, the information from @blounsbury-usbr got me going in the right direction. Ultimately this GitHub page detailing setting up the client from the command line was necessary. @LudiusMaximus original post noted that Puttygen produced a public file that wasn't suitable for GitHub. In Puttygen the UI has the rsa public key right there to copy/paste. In the post if using a Putty key in the UI there, it also would need to be set to use the GitHub SSH address not the https URL for the remote. For the rest of this I personally ended up just doing it all from the command line because I couldn't find all the relevant settings in the TortoiseGit UI that easily. Afterwards I realized that the file path for the SSH public key can just be pasted into the
If you'd rather edit the Global .gitconfig directly you could do that too. The relevant changes to make would be Under signingkey = /PATH/TO/.SSH/KEY.PUB If you're on Windows replace any Then add the following if they don't already exist [gpg]
format = ssh
[commit]
gpgsign = true so it would look something like this And before I get spammed about how insecure it is to keep the key there, this is only to illustrate how it would look. That's not where I keep my keys. If all was done correctly then after the next local commit and then push to GitHub you should have a nice green Verified on the commit. |
Beta Was this translation helpful? Give feedback.
A signing key won’t help associate commits with your GitHub account. What you need to do is set your user name and email address, and the email address must match one of the email addresses that you have configured for your GitHub account. See the GitHub help documentation and the Support Protips article Why is my commit associated with the wrong person? for further information.