Setting up git GPG commit signing on macOS Signing your git commits is the best way to prevent impersonation attacks.