SourceTree commits fail when using Git signed commits
SourceTree is not able to commit a change due to the impossibility to sign it.
The following appears in the SourceTree user interface.
gpg: cannot open `/dev/tty': Device not configured error: gpg failed to sign the data fatal: failed to write commit object
As shown on the following screenshot.
- Check the git command in the SourceTree user interface
- The git command does not contain any neither the
--gpg-signcommand line option
This error occurs when the System Git or the repository has been configured outside of SourceTree to sign all commits, but SourceTree isn't. In this circumstance SourceTree just invokes the System Git instance which attempts to open a dialog with the user. However this is impossible when running within SourceTree.
Setup GPG to sign commits within SourceTree so that the Git commit command line options are added by SourceTree when performing a commit.