Search code examples
gitgithubgit-commitgnupgsign

How to sign my commits to Github repository where I am not the owner?


I am trying to sign my commits in all Github repositories I am associated with. I can sign when the repository is hosted by me, but can not able to sign when I am just a contributor. I get this error mentioned below every time I try to do so.

could not find identity matching specified user-id: <key id>
error: gpg failed to sign the data
fatal: failed to write commit object

below is my .gitconfig setup

[core]
        editor = \"C:\\Users\\user\\AppData\\Local\\Programs\\Microsoft VS Cod>
[user]
        email = <my email id>
        name = <my name>
        signingkey = <key id>
[commit]
        gpgsign = false
[gpg]
        program = gpg

Your small help will be very much appreciated.


Solution

  • Try to clear the git cache or delete the repo from your pc and re-clone it and try to sign your next commits. Let me know if it works.