git-verify-commit

Verify GPG signatures of commits

TLDR

Verify signed commit
$ git verify-commit [commit]
Verify multiple commits
$ git verify-commit [commit1] [commit2]
Show raw signature
$ git verify-commit --raw [commit]
Verbose output
$ git verify-commit -v [commit]

SYNOPSIS

git verify-commit [options] commit...

DESCRIPTION

git verify-commit checks GPG signatures of commits. It verifies that commits were signed with valid GPG keys, confirming the authenticity and integrity of the commit author.This command is useful in workflows that require signed commits for security or compliance purposes.

PARAMETERS

-v, --verbose

Print commit contents.
--raw
Print raw signature.

INSTALL

sudo apt install git
sudo dnf install git
sudo pacman -S git
sudo apk add git
sudo zypper install git
brew install git
nix profile install nixpkgs#git

CAVEATS

The signer's public key must already be available in the local GPG keyring (or configured SSH/X.509 verifier) for verification to succeed; an unknown key results in a failure even if the signature itself is valid. Exits non-zero if any given commit lacks a valid signature.

SEE ALSO

git-commit(1), git-verify-tag(1), git-log(1)

RESOURCES

Documentation · Source code