SourceTree cannot find gpg1: error: cannot run gpg1: No such file or directory

I use /usr/local/bin/gpg1 to sign my Git commits. It's configured as

[gpg]
	program = gpg1

in ~/.gitconfig and works correctly for command-line git. But when commiting in SourceTree, it fails with an error saying it cannot find gpg1:

 

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree commit -q -F /var/folders/87/wkgwm0754tn9csz8295qjmmc000bxz/T/SourceTreeTemp.5qp4T8 
error: cannot run gpg1: No such file or directory
error: gpg failed to sign the data
fatal: failed to write commit object
Completed with errors, see above

 

1 answer

This widget could not be displayed.

Hi Qi Luk, can you confirm you have turned on GPG signing in SourceTree's Repository > Repository Settings > Security tab?

And also, can you confirm you have the actual Commit Options/Sign Commit enabled? Without that checked SourceTree will not attempt to sign the commit. You can visit Setup GPG to sign commits within SourceTree for more information.

If the issue is still occurring, please let us know:

  • Version of SourceTree you're using
  • Version of Git
  • Was this working before and just stopped, or is it the first time you're configuring this?

Best regards,

Ana

>can you confirm you have turned on GPG signing in SourceTree's Repository > Repository Settings > Security tab?

I did have that turned on.

> ... you have the actual Commit Options/Sign Commit enabled?  ...

I do. In my $HOME/.gitconfig I have

[commit]
 gpgsign = true
[gpg]
 program = gpg1

and my command-line git has always been able to commit and sign the commits.

 ❯ which gpg1
/usr/local/bin/gpg1

 ❯ gpg1 --version
gpg (GnuPG) 1.4.21
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Additional info:

* I'm using macOS SourceTree Version 2.4 (89)

* Git: https://www.dropbox.com/s/i6dm7qs1368efkc/Screenshot%202017-05-24%2009.04.05.png?dl=0

* It is the first time I tried to commit and sign in SourceTree.

 

 

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

889 views 2 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you