Skip to content

Commit c369d44

Browse files
Add commit signing with GPG and SSH
This commit adds support for commit signing using GPG and SSH keys in GitKraken Client. It includes the following changes: - Updated the title and description of the "Commit Signing" section to reflect both GPG and SSH key options. - Added a new section on "Commit Signing with SSH" that explains how to generate an SSH key, configure git to sign commits with SSH, create an allowed_signers file, enable commit signing by default in GitKraken, and add the SSH key to remote hosting services. - Included new images for generating an SSH key and selecting a git executable. Please note that Bitbucket.org does not support commit signing verification.
1 parent 19cb341 commit c369d44

File tree

5 files changed

+60
-11
lines changed

5 files changed

+60
-11
lines changed

_images/gkc-git-executable.png

71.2 KB
Loading

_images/[email protected]

184 KB
Loading

_images/gkc-ssh-keygen.png

118 KB
Loading

_images/[email protected]

257 KB
Loading

gitkraken-client/commit-signing-with-gpg.md

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
---
22

3-
title: Commit Signing with gpg
4-
description: Learn how to create GPG keys and sign your commits in GitKraken Client
3+
title: Commit Signing
4+
description: Learn how to sign your commits in GitKraken Client
55
taxonomy:
66
category: gitkraken-client
77

88
---
99

1010
##What is Commit Signing?
1111

12-
In Git, you may commit using any name and email address. However, Git supports signing commits and annotated tags using a GPG key pair.
12+
In Git, you may commit using any name and email address. However, Git supports signing commits and annotated tags using a GPG or SSH key pair.
1313

1414
By signing a commit, other users with your public key can verify the commit was created by the owner of that key. Users can also share their public key with their remote hosting service, such as GitHub, so that commits appear as verified on their website.
1515

16-
###Commit Signing Requirements
16+
###Commit Signing with GPG
17+
18+
####Requirements
1719

1820
Before you start signing your commits, you will first need to install and configure GPG. Our recommendations to get GPG installed quickly are below.
1921

@@ -44,7 +46,7 @@ Once you have installed GPG to your machine, you can verify it is installed and
4446
<img src="/wp-content/uploads/gpg-verify.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
4547

4648

47-
###Generating a GPG Key In GitKraken
49+
####Generating a GPG Key In GitKraken
4850

4951
If you have GPG installed on your local machine, you will be able to generate a GPG key pair from within GitKraken Client.
5052
<div class='callout callout--success'>
@@ -55,7 +57,7 @@ Under `Preferences` → `GPG Preferences`, there is an option to `Generate new G
5557

5658
<img src="/wp-content/uploads/generate-new-gpg-key.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
5759

58-
###Configure GPG in GitKraken
60+
####Configure GPG in GitKraken
5961

6062
Once you have GPG installed on your machine, you will need to configure GitKraken to use GPG. Launch GitKraken Client and navigate to Preferences → GPG Preferences.
6163

@@ -77,7 +79,7 @@ Once you have GPG installed on your machine, you will need to configure GitKrake
7779

7880
+ **Generate new GPG Key:** GitKraken Client will generate a new GPG key for you, see [Generating a GPG Key In GitKraken](/git-workflows-and-extensions/commit-signing-with-gpg/#generating-a-gpg-key-in-gitkraken).
7981

80-
###Verifying a Local Commit is Signed
82+
####Verifying a Local Commit is Signed
8183

8284
You can verify a commit has been signed by selecting a commit and viewing the commit panel. An icon will appear to the left of the commit SHA on signed commits only.
8385

@@ -97,17 +99,17 @@ Below is a list of possible signature codes and what they mean:
9799
+ `ERRSIG` -- It was not possible to check the signature. This may be caused by a missing public key or an unsupported algorithm.
98100

99101

100-
###Uploading Your GPG Key to a Remote Hosting Service
102+
####Uploading Your GPG Key to a Remote Hosting Service
101103

102104
To upload your GPG public key to your remote hosting service, we recommend viewing the documentation for the respective hosting service:
103105

104106
* <em class='context-menu'><i class="fab fa-github"></i></em> [GitHub](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account)
105107
* <em class='context-menu'><i class="fab fa-gitlab" aria-hidden="true"></i></em> [GitLab](https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/#adding-a-gpg-key-to-your-account)
106-
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> [Bitbucket](https://confluence.atlassian.com/bitbucketserver/using-gpg-keys-913477014.html#UsingGPGkeys-AddaGPGkeytoBitbucketServer)
108+
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> Only Bitbucket Server[Bitbucket](https://confluence.atlassian.com/bitbucketserver/using-gpg-keys-913477014.html#UsingGPGkeys-AddaGPGkeytoBitbucketServer)
107109

108110
To copy your GPG public key in GitKraken Client, navigate to Preferences → GPG Preferences and below your Signing Key, select `Copy GPG Public Key`.
109111

110-
###Editing Your GPG Key
112+
####Editing Your GPG Key
111113

112114
Editing your gpg key is helpful when you wish to add another email address to a key or renew an expired key. To edit a GPG key, navigate to your terminal and enter `gpg --list-secret-keys --keyid-format LONG`. This command will output a list of your GPG keys, take note of the ID of the key you wish to edit.
113115

@@ -128,11 +130,58 @@ For a complete list you can review [GNU’s documentation](https://www.gnupg.org
128130

129131
Make sure to upload the updated key on your hosting service once you have saved. See [Uploading Your GPG Key to a Remote Hosting Service](/git-workflows-and-extensions/commit-signing-with-gpg/#uploading-your-gpg-key-to-a-remote-hosting-service).
130132

131-
###Deleting your GPG Key
133+
####Deleting your GPG Key
132134

133135
You can delete your key via terminal with the command `gpg --delete-secret-keys` simply append your username or key ID.
134136
<img src="/wp-content/uploads/delete-key.png" class="img-bordered img-responsive center">
135137

136138
There will be several prompts to make sure that you *really* want to delete your GPG key:
137139
<img src="/wp-content/uploads/delete-key-for-sure.png" class="img-bordered img-responsive center">
138140

141+
###Commit Signing with SSH
142+
143+
SSH signature verification is available in Gitkraken 9.6.0 as Experimental feature
144+
145+
####Requirements
146+
147+
- MacOS and Linux: Git and OpenSSH should be pre-installed. To check if are installed, open a terminal and run
148+
`git -v`
149+
`ssh -V`
150+
- Windows: Install <a href="https://git-scm.com/" target="_blank">Git Bash</a>
151+
152+
153+
####Create SSH Key
154+
155+
Open a Terminal and run this command:
156+
`ssh-keygen -t ed25519 -C "[email protected]"``
157+
158+
<img src="/wp-content/uploads/gkc-ssh-keygen.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
159+
160+
161+
162+
####Configure git to sign commits with SSH
163+
Run this command to use SSH for signing commits and pointing to the key previously created:
164+
`git config --global gpg.format sshgit config --global user.signingkey /PATH/TO/.SSH/KEY.PUB`
165+
166+
167+
####Create allowed_signers file
168+
169+
170+
This file is needed to verify the key used to sign the commits is valid and known by git
171+
`touch ~/.ssh/allowed_signers`
172+
`git config gpg.ssh.allowedSignersFile ~/.ssh/allowed_signers`
173+
`echo "$(git config --get user.email) namespaces=\"git\" $(cat ~/.ssh/<MY_KEY>.pub)" >> ~/.ssh/allowed_signers`
174+
175+
176+
####Enable Commit Signing by Default in Gitkraken:
177+
Preferences > GPG > Sign Commits/Tags By defaultPreferences > Experimental > Use Git Executable and select a git executable 2.34 or later
178+
179+
<img src="/wp-content/uploads/gkc-git-executable.png" srcset="/wp-content/uploads/[email protected] 2x" class="img-bordered img-responsive center">
180+
181+
182+
####Add the SSH key to your remote hosting
183+
184+
* <em class='context-menu'><i class="fab fa-github"></i></em> [GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)
185+
* <em class='context-menu'><i class="fab fa-gitlab" aria-hidden="true"></i></em> [GitLab](https://docs.gitlab.com/ee/user/ssh.html#add-an-ssh-key-to-your-gitlab-account)
186+
* <em class='context-menu'><i class="fab fa-bitbucket" aria-hidden="true"></i></em> Commit Signing verification is not supported on Bitbucket.org
187+

0 commit comments

Comments
 (0)