代码之家  ›  专栏  ›  技术社区  ›  Amin Shah Gilani

默认情况下,如何将git配置为pgp对标记进行签名(而不是提交)

git
  •  0
  • Amin Shah Gilani  · 技术社区  · 7 年前

    我现在有以下内容 ~/.gitconfig :

    [gpg]
        program = /usr/local/bin/krgpg
    [commit]
        gpgSign = true
    [tag]
        forceSignAnnotated = true
    

    提交要求我使用pgp签名:

    git commit -m "Add package.json"
    Krypton ▶ Requesting git commit signature from phone
    

    但是,我只想对我的标记进行签名,并跳过签名提交。

    问题:有没有任何方法可以让我配置Git只签署我的标签?

    我是说,除了别名:

    $ git alias.tag 'tag -s'
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Amin Shah Gilani    7 年前

    我想,这个问题没有得到回答的时间足够长,我的解决方法是唯一的答案。只需设置Git别名:

    git alias.tag 'tag -s'