Skip to content

Instantly share code, notes, and snippets.

@thewh1teagle
Last active July 11, 2024 12:57
Show Gist options
  • Select an option

  • Save thewh1teagle/f1196cd85f71bd85b1674eb77c5d016a to your computer and use it in GitHub Desktop.

Select an option

Save thewh1teagle/f1196cd85f71bd85b1674eb77c5d016a to your computer and use it in GitHub Desktop.
Git commit signing on Windows

Commit signing on with Git on macOS, Windows and Linux.

Prerequisites:

  1. Install gpgtools on macOS and git on Windows or sudo apt-get install gpa seahorse git on Linux.
  2. Open notepad.exe
  3. Open github.com/settings/emails
  4. Copy your Github email to notepad (ends with @users.noreply.github.com)
  5. Open cmd.exe
  6. Create new ssh key
ssh-keygen -t ed25519 -C "{email}"

You can press enter in the prompts.

  1. Open both public and private key files in text editor and then paste them to notepad.exe
  2. Open github.com/settings/ssh/new
  3. Set title to {Day/Month/Year}, value to public key value, key type to signingKey
  4. Configure git
git config --global user.name "{username}"
git config --global user.email "{email}"
git config --global user.signingkey "C:\Users\{username}\.ssh\{key_name}.pub"
git config --global commit.gpgsign true
git config --global gpg.format ssh

That's it ๐Ÿ‘๐Ÿผ๐Ÿ˜Š

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment