- 
      
 - 
        
Save priyanshuvishnoi/e7e066ce4ae19b602b42cab1da7072f9 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
paolocarrasco revised this gist
Sep 24, 2021 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,15 +37,15 @@ We can have many problems, but I list what I found: 1. Another thing could be that *the secret key was not set properly* (In my case the message said `gpg: signing failed: No secret key` as it can be see in the image below).  It means that is not finding the key that was set. You would need to set up the GPG key in Git (again): - List the secret keys available in GPG. ```shell gpg --list-secret-keys --keyid-format=long ``` - Copy your key - Set your key for your user in git ```shell git config --global user.signingkey <your key> ``` 1. You can see in the thread of this gist other ways to find the solution to other problems. I recommend to read the [Github guide for signing commits with GPG](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key). Hope it helps!  - 
        
paolocarrasco revised this gist
Sep 24, 2021 . 1 changed file with 14 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ For understanding what's going on, first check what git is doing, so add `GIT_TR GIT_TRACE=1 git commit ``` With that you can see what GPG is doing: Probably you will see something like this ``` 10:37:22.346480 run-command.c:637 trace: run_command: gpg --status-fd=2 -bsau <your GPG key> @@ -26,18 +26,26 @@ Execute that gpg command again in the command line: ``` gpg --status-fd=2 -bsau <your GPG key> ``` 👆🏻 With this now you could see what happened in detail! Solutions --------- We can have many problems, but I list what I found: 1. It could be that the *GPG key was expired*: https://stackoverflow.com/a/47561300/532912 1. Another thing could be that *the secret key was not set properly* (In my case the message said `gpg: signing failed: No secret key` as it can be see in the image below).  It means that is not finding the key that was set. You would need to set up the GPG key in Git (again): 1. List the secret keys available in GPG. ```shell gpg --list-secret-keys --keyid-format=long ``` 1. Copy your key 1. Set your key for your user in git ```shell git config --global user.signingkey <your key> ``` 1. You can see in the thread of this gist other ways to find the solution to other problems. I recommend to read the [Github guide for signing commits with GPG](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key). Hope it helps!  - 
        
paolocarrasco revised this gist
Sep 24, 2021 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,18 +22,22 @@ Probably you will see something like this ``` (Check if your GPG key is correct) Execute that gpg command again in the command line: ``` gpg --status-fd=2 -bsau <your GPG key> ``` Now you could see what happened in detail! Solutions --------- We can have many problems, but I list what I found: 1. It could be that the GPG key was expired: https://stackoverflow.com/a/47561300/532912 1. Another thing could be that the secret key was not set (In my case the message said `gpg: signing failed: No secret key` as it can be see in the image below).  It means that is not finding the key that was set. 1. You can see in the thread of this gist other ways to find the solution to other problems. I recommend to read the [Github guide for signing commits with GPG](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key). Hope it helps!  - 
        
paolocarrasco revised this gist
Sep 24, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,9 +10,9 @@ fatal: failed to write commit object Debug ----- For understanding what's going on, first check what git is doing, so add `GIT_TRACE=1` at the beginning of the command you used before (`git commit` or `git rebase`): ``` GIT_TRACE=1 git commit ``` With that you can see what the problem can be. And what GPG is doing:  - 
        
paolocarrasco created this gist
Aug 29, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ Problem ------- You have installed GPG, then tried to commit and suddenly you see this error message after it: ``` error: gpg failed to sign the data fatal: failed to write commit object ``` Debug ----- For understanding what's going on, first check what git is doing: ``` GIT_TRACE=1 git rebase --continue ``` With that you can see what the problem can be. And what GPG is doing: Probably you will see something like this ``` 10:37:22.346480 run-command.c:637 trace: run_command: gpg --status-fd=2 -bsau <your GPG key> ``` (Check if your GPG key is correct) Repeat that gpg command again in the command line: ``` gpg --status-fd=2 -bsau <your GPG key> ``` Solutions --------- We can have many problems, but I list what I found: 1. It could be that the GPG key was expired: https://stackoverflow.com/a/47561300/532912 1. Another thing could be that the secret key was not set (the message says `gpg: signing failed: No secret key`). It means that is not finding the key that was set (it happened to me because I preppended a number). Hope it helps!