git-plus icon indicating copy to clipboard operation
git-plus copied to clipboard

git commit fails - error: gpg failed to sign the data

Open JayDub72 opened this issue 8 years ago • 5 comments

Is this a question or a feature request? If so please start the title with [QUESTION] or [REQUEST].

Are you on a windows machine and do you have trouble pushing to remote repositories? Check out this thread first because it probably has the solution and answers.

Are you having problems using submodules in atom with this package? Check out this thread.

Are you running MacOs 10.12 Sierra and having issues pulling/pushing? Check out this comment.

Did you update the package and you are seeing this message Failed to load the git-plus package? Run apm install from the package's directory and restart atom.

I am unable to commit my staged changes. I type in a message for the commit and receive an error message "Unable to commit. error: gpg failed to sign the data fatal: failed to write commit object"

I am able to execute a git commit -m "blah blah" command via terminal and it works perfectly (it prompts me for my passphrase and the commits the changes). I am never prompted for my passphrase from Atom. I have already made sure that my username and email are in the .gitconfig file as well set the helper to osxkeychain. I have also made sure that the username and password are in the keychain for github.

Thanks!

Steps to reproduce:

  1. Open Atom // project with files from github
  2. Toggle Git tab to be visible
  3. Modify file(s)
  4. Promote file to staged changes
  5. Enter commit message and click Commit screen shot 2017-12-03 at 10 07 54 pm

JayDub72 avatar Dec 04 '17 04:12 JayDub72

Update: Installed this on a fresh Mac and did NOT have the problem. I was prompted for the username and passphrase the first time I tried to commit. Worked flawlessly after that. No clue why it won't work on the original Mac. I will try clean uninstall and rebuild.

JayDub72 avatar Dec 05 '17 18:12 JayDub72

Removing and reinstalling did not fix the problem. I removed the .atom directory as well when I did a fresh install.

JayDub72 avatar Dec 06 '17 01:12 JayDub72

This is a git configuration problem You probably have the option commit.gpgsign=true in your git config, which requires every commit to be signed with a GPG key, and don't have a propperly configured GPG key for signing commits

You can check which level of the git configurations has this option enabled:

git config --local -l
git config --global -l
git config --system -l

When you find where it is:

git config --[local|global|system] --unset commit.gpgSign

Fryuni avatar Dec 21 '17 16:12 Fryuni

This will help you to get rid of it

git config --global commit.gpgsign false

nmanikumar5 avatar Jul 12 '18 10:07 nmanikumar5

This is what worked for me

git config --global commit.gpgsign false

Erik-Handeland avatar Jan 07 '19 21:01 Erik-Handeland