It's a classic situation. You're contributing to a project, filed your pull request, and gotten it approved by your peers. You're all ready to merge your code and add your humble contribution to the project when, out of nowhere, GitHub gives you this:
How do you go about doing this, especially when you've already committed your work and pushed it to the server? How do you retroactively sign your Git commits? We'll do this in six steps:
- Gather Information
- Install GPG
- Create or use a key
- Set up Git to sign commits using GPG
- Rebase your commits
- Overwrite your branch with your newly signed commits
There's a lot to unpack, so we're going to need six steps. Also, these instructions are for macOS; Windows and Linux users may have different commands.