Skip to content

Commit

Permalink
chore(boilerplate): update git-setup.md with info about GPG keys fo…
Browse files Browse the repository at this point in the history
…r signed git commits

#1
  • Loading branch information
jgeluk committed Nov 29, 2024
1 parent e4a0890 commit 8195c2a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/contribute/git-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,52 @@ git config --local branch.autosetuprebase always
git config --local merge.ff only
```

## Configure signed git commits

Assuming you have [Homebrew](https://brew.sh) installed:

```shell
git config --local commit.gpgsign true
brew update
brew upgrade
brew uninstall gpg
brew install gpg2
git config --local gpg.program /usr/local/bin/gpg
git config --local commit.gpgsign true
```

Then after gpg has been installed, create a key:

```shell
gpg --full-generate-key
```

Then show all keys:

```shell
gpg --list-keys
```

Then copy the long number of your key into the clipboard
and register it as follows:

```shell
git config --local user.signingkey <Key from your list>
```

Then tell GitHub know what your key is by first exporting it
(copy the output &mdash; with START and END line included &mdash; into the clipboard):

```shell
gpg --armor --export <Key from your list>
```

Then add this key to GitHub at GPG keys: <https://github.com/settings/keys>

Your commits should now work and be signed.

Check [GitHub docs](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits) for other options.

## References

- [How to prevent merge conflicts](https://dev.to/github/how-to-prevent-merge-conflicts-or-at-least-have-less-of-them-109p)
Expand Down

0 comments on commit 8195c2a

Please sign in to comment.