4

I'm commiting my GIT repository and terminal shows some issues.

After I type $ git commit terminal display editor with where I must uncomment line where is Initial commit so I done it at departure from editor I type :wq, terminal get me back to default screen and display this errors

error: cannot run gpg: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object

In $ git status I have following things

$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   app.js
    new file:   index.html

Repository was created, all files is TRACKED and files can't be commited.

I'm beginner so sorry for some issues.

Matúš Rebroš
  • 141
  • 1
  • 7
  • Have you had a look at this? https://stackoverflow.com/questions/39494631. **tldr** try `git config --global gpg.program gpg1` – Leighton May 06 '19 at 08:20

1 Answers1

4

The error tells you that when the gpg was attempted to be executed, the program was not found, so, if you will need to set up gpg. When that's done, you will need to find out which are the GPG keys which have both public and private keys:

gpg --list-secret-keys --keyid-format LONG

From the keys you see, choose the one which you intend to use and run

git config --global user.signingkey <yourkey>

Read more here: https://help.github.com/en/articles/telling-git-about-your-signing-key

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175