Goje87 Goje87 - 4 months ago 28
Git Question

why does source tree look for gpg keys while I haven't configured for signing?

I downloaded sourcetree app on my mac and added a local git repo to it. Whenever I try to stash something or commit something, sourcetree throws gpg related errors. An example error is as below.

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree stash save test-stash
/Applications/SourceTree.app/Contents/Resources/bin/gpg: line 2: gpg2: command not found
error: gpg failed to sign the data
Cannot save the current index state
Completed with errors, see above

I am unable to figure out the cause for this error. As far as I remember, I have not configured either the project or sourcetree app for any sort of signing.

It'd be of a great help if you could help me with troubleshooting this issue.


Even if I try committing from command line, it asks for gpg keys.

After a lot more search on internet I found the root cause. It was due to one of the dotfiles that set the global config for signing commits in ~/.gitconfig as true. Therefore, I set the config back to false using following command.

$ git config --global commit.gpgsign false

Phew! The issue is resolved now...