Minimal application that showcases how to create SSH-signed commits in Rust with the two popular crates git2 (crates.io, docs.rs) and gix (crates.io, docs.rs).
Note: This sample expects an existing SSH key in your home directory ~/.ssh
. If it is encrypted it will interactively ask for the password to decrypt it for the signing step.
Although not documented anywhere, the gpgsig
header is used for SSH signatures as well. This can be verified by making a signed commit with the Git CLI, assuming it is properly configured for SSH signing.
Then, the raw git commit can be inspected with the following command in any git repo:
git rev-list --format=raw --max-count=1 HEAD
This project is licensed under MIT License (or http://opensource.org/licenses/MIT).