My repo settings can be seen in the below screenshot, I am looking for a way to set up GPG signing in Source Tree specifically. I have set it up to work via Git which Sourcetree leverages, but wondered if I am missing something?
For anyone looking for an answer here, there is a fairly simple way around this using the following instructions:
Open Git Bash.
Use the gpg --list-secret-keys --keyid-format LONG
command to list GPG keys for which you have both a public and private key. A private key is required for signing commits or tags.
gpg --list-secret-keys --keyid-format LONG
Note: Some GPG installations on Linux may require you to use gpg2 --list-keys --keyid-format LONG
to view a list of your existing keys instead. In this case you will also need to configure Git to use gpg2
by running git config --global gpg.program gpg2
.
From the list of GPG keys, copy the GPG key ID you'd like to use. In this example, the GPG key ID is 3AA5C34371567BD2
:
gpg --list-secret-keys --keyid-format LONG
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot
ssb 4096R/42B317FD4BA89E7A 2016-03-10
To set your GPG signing key in Git, paste the text below, substituting in the GPG key ID you'd like to use. In this example, the GPG key ID is 3AA5C34371567BD2
:
git config --global user.signingkey 3AA5C34371567BD2
To configure your Git client to sign commits by default for a local repository, in Git versions 2.0.0 and above, run git config commit.gpgsign true
. To sign all commits by default in any local repository on your computer, run git config --global commit.gpgsign true
.
To store your GPG key passphrase so you don't have to enter it every time you sign a commit, we recommend using the following tools:
You can also manually configure gpg-agent to save your GPG key passphrase, but this doesn't integrate with Mac OS Keychain like ssh-agent and requires more setup.
This method will result in a password prompt for your GPG key when committing via Sourcetree.
Hi
I'm afraid GPG signing is not directly supported in Sourcetree for Windows currently.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
but why following side exists https://confluence.atlassian.com/sourcetreekb/setup-gpg-to-sign-commits-within-sourcetree-765397791.html where you can configure it ????
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@minnsey I see this comment of yours is 5 years old. And still, I don't see the option in Sourcetree in Windows.
In our company, gpg has been mandatory & I don't see support in sourcetree. Should I abandon sourcetree?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.