git 2.0 has the config option commit.gpgsign
which will sign all commits.
This will also apply for git stash
and will ask for the password of my gpg key.
Is ther a way to automatically sign all commits, tags,... but exclude stashes?
git 2.0 has the config option commit.gpgsign
which will sign all commits.
This will also apply for git stash
and will ask for the password of my gpg key.
Is ther a way to automatically sign all commits, tags,... but exclude stashes?
This is alias territory:
git config --global alias.stashq '-c commit.gpgsign=false stash'
I like jthill's answer, just wanted to provide a slightly different option so you don't have to learn to type a new command. You can define a shell function in your .bashrc
like this:
git() {
case $1 in
stash) set -- -c commit.gpgsign=false "$@" ;;
esac
command git "$@"
}
Now when you run git stash
then the shell function inserts the extra arguments before calling the git binary.