Xcode GPG not found issue

If you use GPG and Xcode you may have run into this error.

Xcode error message saying GPG cannot be found

From what I can tell if doesn’t really matter and you can still commit just fine (in the terminal if you want to use GPG), but it was annoying me. So I went spelunking and found this post on GitHub. In the post the author shares a git config command we can use to solve the issue.

git config --global gpg.program $(which gpg)

Run this in your terminal and then when you create a project in Xcode, the warning should go away. Expect that you’ll need to enter your GPG password (if you have one) on the next project creation.

For reference, here is the gist I followed to set up my GPG key for macOS.