Skip to content

Instantly share code, notes, and snippets.

@palexander
Forked from xavierfoucrier/gpg-signing.md
Created March 25, 2020 23:10
Show Gist options
  • Select an option

  • Save palexander/267d7305bd545452f4bda32fe0f02f94 to your computer and use it in GitHub Desktop.

Select an option

Save palexander/267d7305bd545452f4bda32fe0f02f94 to your computer and use it in GitHub Desktop.

Revisions

  1. @xavierfoucrier xavierfoucrier revised this gist Jan 2, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gpg-signing.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ _(if you don't want to type a passphrase on every commit, you need to press "Ent
    - _YOUR_GITHUB_EMAIL_: the **email address** used to login on Github
    - _YOUR_SIGNING_KEY_: the **GPG key** used to sign commits, should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1
    - _GPG_BINARY_PATH_: the **GPG binary file path**, depending on your Git install and your operating system:
    - Windows: `gpg.exe` or `C:\Program Files\Git\usr\bin\gpg.exe` _(can be found using `gcm gpg` in a terminal)_
    - Windows: `gpg`, `gpg.exe` or `C:\\Program Files\\Git\\usr\\bin\\gpg.exe` _(can be found using `where gpg` in a terminal)_
    - Mac or Linux: `gpg` or `/usr/local/bin/gpg` _(can be found using `which gpg` in a terminal)_

    3. Enjoy **signed commits** with your favorite code editor!
  2. @xavierfoucrier xavierfoucrier revised this gist Oct 1, 2019. No changes.
  3. @xavierfoucrier xavierfoucrier revised this gist Oct 1, 2019. 1 changed file with 17 additions and 11 deletions.
    28 changes: 17 additions & 11 deletions gpg-signing.md
    Original file line number Diff line number Diff line change
    @@ -1,25 +1,31 @@
    Hi Windows users,
    Hi Github users,

    I can now signed my commits on Github using **Git 2.18.0** and **Github Desktop 1.6.1**.
    You can now signed your commits on Github using at least **Git 2.18.0** and **Github Desktop 1.6.1**.

    Here is what I have done:
    - add `C:\Program Files\Git\usr\bin` to the environment **PATH** (depends on your Git install) to allow Windows to locate the `gpg.exe` program
    - generate a **GPG key** and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key
    1. Generate a **GPG key** and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key
    _(if you don't want to type a passphrase on every commit, you need to press "Enter" when the console will prompt you to type a passphrase)_
    - configure the Git `.gitconfig` file properly:

    ```
    2. Configure **Git** properly by editing the `.gitconfig` file using the command line `git config --global --edit` in a terminal, then replace _YOUR_GITHUB_EMAIL_, _YOUR_SIGNING_KEY_ and _GPG_BINARY_PATH_ with your data

    ```ini
    [user]
    name = Xavier Foucrier
    email = YOUR_GITHUB_EMAIL
    signingkey = YOUR_SIGNING_KEY
    [gpg]
    program = gpg.exe
    program = GPG_BINARY_PATH
    [commit]
    gpgsign = true
    ```
    > this file is located in the `%USERPROFILE%` directory, ie: `C:\Users\Xavier\.gitconfig`

    YOUR_SIGNING_KEY should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1.
    - _YOUR_GITHUB_EMAIL_: the **email address** used to login on Github
    - _YOUR_SIGNING_KEY_: the **GPG key** used to sign commits, should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1
    - _GPG_BINARY_PATH_: the **GPG binary file path**, depending on your Git install and your operating system:
    - Windows: `gpg.exe` or `C:\Program Files\Git\usr\bin\gpg.exe` _(can be found using `gcm gpg` in a terminal)_
    - Mac or Linux: `gpg` or `/usr/local/bin/gpg` _(can be found using `which gpg` in a terminal)_

    3. Enjoy **signed commits** with your favorite code editor!

    > Note that you can temporary disable GPG signed commits by setting `gpgsign = false` in your `.gitconfig` file with `git config --global commit.gpgsign false`
    That's all folks! :tada:
    That's all folks! :tada:
  4. @xavierfoucrier xavierfoucrier revised this gist May 3, 2019. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions gpg-signing.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,8 @@ I can now signed my commits on Github using **Git 2.18.0** and **Github Desktop

    Here is what I have done:
    - add `C:\Program Files\Git\usr\bin` to the environment **PATH** (depends on your Git install) to allow Windows to locate the `gpg.exe` program
    - generate a **GPG key** and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key (note that if you don't want to type a passphrase on every commit, you need to press Enter when the console will prompt you to type a passphrase)
    - generate a **GPG key** and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key
    _(if you don't want to type a passphrase on every commit, you need to press "Enter" when the console will prompt you to type a passphrase)_
    - configure the Git `.gitconfig` file properly:

    ```
    @@ -17,7 +18,8 @@ Here is what I have done:
    [commit]
    gpgsign = true
    ```
    > this file is located in the `%USERPROFILE%` directory, ie: `C:\Users\Xavier\.gitconfig`
    YOUR_SIGNING_KEY should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1.

    That's all folks! :tada:
    That's all folks! :tada:
  5. @xavierfoucrier xavierfoucrier created this gist Apr 29, 2019.
    23 changes: 23 additions & 0 deletions gpg-signing.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    Hi Windows users,

    I can now signed my commits on Github using **Git 2.18.0** and **Github Desktop 1.6.1**.

    Here is what I have done:
    - add `C:\Program Files\Git\usr\bin` to the environment **PATH** (depends on your Git install) to allow Windows to locate the `gpg.exe` program
    - generate a **GPG key** and add it to Github: https://help.github.com/articles/generating-a-new-gpg-key (note that if you don't want to type a passphrase on every commit, you need to press Enter when the console will prompt you to type a passphrase)
    - configure the Git `.gitconfig` file properly:

    ```
    [user]
    name = Xavier Foucrier
    email = YOUR_GITHUB_EMAIL
    signingkey = YOUR_SIGNING_KEY
    [gpg]
    program = gpg.exe
    [commit]
    gpgsign = true
    ```

    YOUR_SIGNING_KEY should follow the GPG key ID convention, like this example: https://help.github.com/articles/telling-git-about-your-signing-key/#telling-git-about-your-gpg-key-1.

    That's all folks! :tada: