GPG签名所有git提交没有藏匿

f0i*_*f0i 11 git sign gnupg git-stash

git 2.0有config选项commit.gpgsign,它将签署所有提交.

这也适用于git stash并将要求我的gpg密钥的密码.

是一种自动签署所有提交,标签,...但排除存储的方法吗?

jth*_*ill 15

这是别名领域:

git config --global alias.stashq '-c commit.gpgsign=false stash'
Run Code Online (Sandbox Code Playgroud)


Aro*_*fis 7

我喜欢jthill的答案,只是想提供一个稍微不同的选项,所以你不必学习输入一个新的命令.您可以在此处定义shell函数.bashrc:

git() {
  case $1 in
    stash) set -- -c commit.gpgsign=false "$@" ;;
  esac
  command git "$@"
}
Run Code Online (Sandbox Code Playgroud)

现在,当你运行时git stash,shell函数在调用git二进制文件之前插入额外的参数.