Skip to content

Instantly share code, notes, and snippets.

@priyanshuvishnoi
Forked from paolocarrasco/README.md
Created November 2, 2021 16:04
Show Gist options
  • Save priyanshuvishnoi/e7e066ce4ae19b602b42cab1da7072f9 to your computer and use it in GitHub Desktop.
Save priyanshuvishnoi/e7e066ce4ae19b602b42cab1da7072f9 to your computer and use it in GitHub Desktop.

Revisions

  1. @paolocarrasco paolocarrasco revised this gist Sep 24, 2021. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions README.md
    Original 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).
    ![image](https://user-images.githubusercontent.com/1524522/134691912-b0fdd04b-344a-4b02-9ff9-68cba7f9f0fb.png)
    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>
    ```
    - 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!
  2. @paolocarrasco paolocarrasco revised this gist Sep 24, 2021. 1 changed file with 14 additions and 6 deletions.
    20 changes: 14 additions & 6 deletions README.md
    Original 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 the problem can be. And what GPG is doing:
    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>
    ```

    Now you could see what happened in detail!
    👆🏻 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 (In my case the message said `gpg: signing failed: No secret key` as it can be see in the image below).
    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).
    ![image](https://user-images.githubusercontent.com/1524522/134691912-b0fdd04b-344a-4b02-9ff9-68cba7f9f0fb.png)
    It means that is not finding the key that was set.
    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!
  3. @paolocarrasco paolocarrasco revised this gist Sep 24, 2021. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions README.md
    Original 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)

    Repeat that gpg command again in the command line:
    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 (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).
    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).
    ![image](https://user-images.githubusercontent.com/1524522/134691912-b0fdd04b-344a-4b02-9ff9-68cba7f9f0fb.png)
    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!
  4. @paolocarrasco paolocarrasco revised this gist Sep 24, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original 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:
    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 rebase --continue
    GIT_TRACE=1 git commit
    ```

    With that you can see what the problem can be. And what GPG is doing:
  5. @paolocarrasco paolocarrasco created this gist Aug 29, 2018.
    39 changes: 39 additions & 0 deletions README.md
    Original 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!