In my case, the SourceTree (version 3.4.23, GPG 2.4.7) setting worked:
Tools->Options->Git:
In the Git Version zone, click the System button: