Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
enable signed git commits for a repository
#!/bin/bash
echo "Add to local git repository sign commits capabilities"
# Add it at the root level of your git repositoes, and call the script inside a git repo
# E.g.: cd my_git_repo
# ..path_to../signed-commits.h
echo "======================================================"
echo "Curent git repo local settings:"
echo "------------------------------------------------------"
git config --local --list
# Apply git repo settings for signed commits
git config --local user.name "FirstName LastName"
git config --local commit.gpgsign "true"
git config --local user.signingkey "signing key value (E.g. A980A980C5A928C5A9Q0A)"
git config --local user.email "firstname.lastname@example.org"
echo "------------------------------------------------------"
echo "New git repo config locals settings:"
echo "------------------------------------------------------"
git config --local --list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment