SoftEngStudent
SoftEngStudent

Reputation: 159

git error: could not find identity matching specified user-id

So I just spent forever following the git instructions on how to generate a gpg key and sign my commits so they will show up in on my account. Followed everything to the T and got to these final steps with no complications:

git config --global user.signingkey 70DA..(my key)
git config --global commit.gpgsign true

BUT, when I finally go to:

git add .
git commit -S -m "whatever message"

I'm getting these three errors:

could not find identity matching specified user-id: 70DA..(my key)
error: gpg failed to sign the data
fatal: failed to write commit object

I've seen the last two errors in other posts, but not the one about a specified user-id. Does anyone know how to fix this or know of some short cut to verify my commits? I feel like 2 hours is a stupid amount of time to spend on this and I'm mildly embarrassed.

Upvotes: 5

Views: 2348

Answers (2)

marquitobb
marquitobb

Reputation: 438

You must add your list of keys, example

$ smimesign --list-keys

$ smimesign --list-keys
         ID: 0ff455a2708394633e4bb2f88002e3cd80cbd76f
        S/N: a2dfa7e8c9c4d1616f1009c988bb70f
  Algorithm: SHA256-RSA
   Validity: 2017-11-22 00:00:00 +0000 UTC - 2020-11-22 12:00:00 +0000 UTC
     Issuer: CN=DigiCert SHA2 Assured ID CA,OU=www.digicert.com,O=DigiCert Inc,C=US
    Subject: CN=Octocat,O=GitHub\, Inc.,L=San Francisco,ST=California,C=US
     Emails: [email protected]

$ git config --global user.signingkey 0ff455a2708394633e4bb2f88002e3cd80cbd76f

$ git config --local user.signingkey 0ff455a2708394633e4bb2f88002e3cd80cbd76f

this link https://docs.github.com/es/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key

Upvotes: 0

ix0rai
ix0rai

Reputation: 49

Check if the email address and user id in .gitconfig are the same as the ones in your gpg key, and ensure that gpg.format is unset. See https://stackoverflow.com/a/60939372/13765314

Upvotes: 2

Related Questions