Skip to content

Instantly share code, notes, and snippets.

@Chinmay1743
Last active September 4, 2022 10:16
Show Gist options
  • Save Chinmay1743/077ad467a4a1b975cfcb3e37efdb7d58 to your computer and use it in GitHub Desktop.
Save Chinmay1743/077ad467a4a1b975cfcb3e37efdb7d58 to your computer and use it in GitHub Desktop.
A Gist to verify all previous commits from a specific commit.

Sign Old Git commits as Verified



Warning : I will not be responsible for any data loss. This snippet marks all commits as verified but changes commit time & date as well as the original commit hash.

Impact : Commit linked to any issue will show error + everything will be recommitted hence same date, time and changed hash.

Result : Proceed with caution.


Run the following command :

git rebase --signoff -S HEAD~2

Replace HEAD~2 with Hash of the last commit from which you wish to sign all commits. Run git push -f to apply changes. Now all your previous unverified commits should be verified :) although the time and date of commits will change from previous values to same. Original commit hash will be replaced by new ones.

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