A bash script for sign your commits
Introduction • Requirements • Usage • Examples
This bash script has been designed to help you configure your environment to sign your commits with a GPG key.
Official documentation :
- Ubuntu or Debian OS
- gpg
- git
- root privilege
$ su
$ chmod +x sign-my-code.sh
$ ./sign-my-code.sh
or
$ sudo chmod +x sign-my-code.sh
$ sudo ./sign-my-code.sh
Follow these steps in order :
- Execute this script with root privilege
- Install gpg & git packages
- Generate a new GPG key
- Add a GPG key to your GitHub account
- Tell Git about your signing key
- Sign commits examples
- Quit
Scenario 2 : You want to sign your commits with an existing GPG key, and GPG/Git packages is already installed
Follow these steps in order :
- Add a GPG key to your GitHub account
- Tell Git about your signing key
- Sign commits examples
- Quit
Other scenarios are possible, just select the option that will help you ;-)
Test performed in an Xubuntu 22.04.3 LTS virtualbox machine with root privilege.
Execute this script :
Install gpg & git packages :



