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
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...