gpt4 book ai didi

git - 多于一行 git commit 信息

转载 作者:行者123 更新时间:2023-12-04 15:46:19 25 4
gpt4 key购买 nike

我们在 Eclipse 中使用 git(图形 git)。我们的提交声明有一个描述,然后是一个变更 ID。我们的描述必须在开头有一个 JIRA 故事。

我的问题是我在提交中永远不能有超过一行,否则它会提示(见下图)。这其实只是一行,而是绕了一个“场”字。你不能用一行来描述。有谁知道解决这个问题的方法吗?

enter image description here

最佳答案

Git 文档在 git commit 中说(强调我的):

Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git. For example, git-format-patch1 turns a commit into email, and it uses the title on the Subject line and the rest of the commit in the body.

所以 git 本身 确实 处理几个“物理”行直到第一个空行作为一个“逻辑”行并显示它,例如使用 git log --oneline。其他工具可能会或可能不会这样做。

因此您可以忽略该警告。

关于git - 多于一行 git commit 信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55620675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com