Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Rebase/stash not working after enabling GPG signing

I've enabled GPG commit signing on the command line, and manually enabled via the "Repository Settings" section of SourceTree for each repo:

Screen Shot 2016-04-11 at 15.12.48.png

If I manually select "Sign commit" each time SourceTree correctly signs my commits:

Screen Shot 2016-04-11 at 15.16.48.png

However any other operation like stash or rebase doesn't seem to include the GPG options in the command and I get the following "gpg: cannot open `/dev/tty': Device not configured" error:

Screen Shot 2016-04-11 at 15.18.41.png

I see you even have a support article about this, but the proposed solution is enabling GPG signing in SourceTree which I've already done.

5 answers

git config --global gpg.program gpg2

This maybe your answer.

Thanks for your answer Aditya, I'm afraid I already have this set in my config though.

this did the trick for me, thanks!

Remove the gpgsign attribute in the [commit] section of your .gitconfig if it's there.

This solved it for me.

Won't that just disable GPG signing of commits by default? I'd like to keep this on, and think SourceTree should respect it.

I have to manually select "Sign Commit" in SourceTree anyways, even with the attribute enabled.

So I think it only takes effect for commits done via Terminal. Have you restarted SourceTree after modifying the config?

I have, and SourceTree doesn't respect this global git default. I'd rather not remove this since I want all commits to be signed - SourceTree should improve its GPG support.

Absolutely, it would make more sense for them to enhance the software to respect the standards.

Honestly, I've stopped using stashes because of this issue, which is really annoying :-/ The workaround I proposed above is NOT viable at all.

Please Atlassian, make SourceTree work better with GPG!

edit: Check this out, worked perfectly for me!

@Armando Lüscher thank you for finding that and letting me know!!

I confirm that I am having same issue with rebasing.


Nope, I'm still having this issue. Please upvote/share to get it noticed!

I'm having the same issue.

Disabling the key signing for the repository also doesn't help, I can't stash anything any more!


Any news on this?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

62,501 views 128 27
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you