Skip to content

Instantly share code, notes, and snippets.

View fernandoporazzi's full-sized avatar

Fernando Porazzi fernandoporazzi

  • Bitvavo
  • Amsterdam
View GitHub Profile
@fernandoporazzi
fernandoporazzi / sign-previous-commits.md
Created September 2, 2025 09:52 — forked from sbolel/sign-previous-commits.md
How to sign previous commits in a PR

To sign all your commits in the Git Pull Request (PR), you can use a combination of git rebase and git commit --amend. Here are the steps:

  1. Before starting, make sure you've configured Git to use your signing key. You can do this with:

    git config --global user.signingkey YOUR_SIGNING_KEY
    git config --global commit.gpgsign true

    Replace YOUR_SIGNING_KEY with your GPG key ID.

  2. Then you need to start an interactive rebase with the parent of your first commit. If you don't know what commit that is, you can use git log to display your commit history. Once you have your commit hash, start the rebase: