【问题标题】:Prevent PhpStorm from adding “Signed-off-by: …” at the end of commit message防止 PhpStorm 在提交消息末尾添加“Signed-off-by: ...”
【发布时间】:2018-06-22 02:15:56
【问题描述】:

当我使用命令行使用git 创建提交时,提交消息不会改变。

当我通过 PhpStorm 的 GUI 创建提交并选中“Sign-off commit”复选框时,PhpStorm 在我的提交消息末尾添加此行:

Signed-off-by: Firstname Lastname <me@example.com>

如何预防?我不希望 PhpStorm 在每次提交结束时写下“Signed-off-by: ...”。


这是我的 git 配置:

$ git config --list
commit.gpgsign=false
user.signingkey=…
user.name=Firstname Lastname
user.email=me@example.com
push.default=current
core.excludesfile=/home/…/.gitignore_global
fetch.prune=true
rebase.autosquash=true
gpg.program=gpg2
format.signoff=false
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.com:Victoire/victoire.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
commit.gpgsign=true

【问题讨论】:

  • 取消选中“注销”复选框。这是 git 的功能,而不是 PhpStorm。
  • @sircapsalot 但是 git CLI 没有添加这一行,看起来它来自 PhpStorm。
  • git CLI,您可以使用-s 签署提交。 git commit -s ... 该复选框允许这样做。尝试提交,但没有选中 PhpStorm 中的“signoff commit”复选框
  • @sircapsalot 我创建了一个新的提交并且未选中“Sign-off commit”,它要求我输入密码。那么“Sign-off commit”复选框的作用就是添加这个文本?我以为它的作用是启用或禁用 GPG 签名……
  • 那个复选框肯定把它放进去,是的。它主要是一个视觉指示器。它告诉任何看到它的人“这是一个正确的开源许可提交”。不要认为它与 GPG 签约有任何关系

标签: git phpstorm phpstorm2017.3


【解决方案1】:

“Signed-off-by”消息实际上来自 Git,而不是 PhpStorm。

您可以通过取消选中“Sign-off commit”复选框来禁用此注销消息。

取自 this answer 关于签署提交。

在提交日志消息的末尾添加提交者的 Signed-off-by 行。 签核的含义取决于项目,但它通常证明提交者有权在同一许可下提交此作品并同意开发者原产地证书(有关更多信息,请参阅http://developercertificate.org/)。

仅供参考,这不应与“签名”提交混淆。签署提交与 GPG 密钥有关,而“签署”仅与提交后缀的任意消息有关。

【讨论】:

    【解决方案2】:

    必须取消选中“Sign-off commit”复选框,以便提交消息中不会添加任何内容。

    “Sign-off commit”复选框的作用不是启用 GPG 签名,而是启用在提交消息末尾添加“Signed-off-by: ...”行。

    【讨论】:

      猜你喜欢
      • 2015-06-26
      • 2012-11-07
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多