我需要遵循以#
(例如#1234 ...
)开头的git commit消息格式。
这不是Start a git commit message with a hashmark (#)的副本,因为我了解commentchar
,并且已经将git
配置为使用其他注释字符了:3> >
gino@myrepo$ git config --global --get core.commentchar
;
gino@myrepo$ git config --get core.commentchar
;
我也已经确认,如果我从命令行提交,它将起作用:
gino@myrepo$ git log
Author: ...
Date: Wed Nov 13 21:59:40 2019 +0900
# Test `git commit` from terminal
# These 2 lines should not be treated as comments
问题是,当我尝试从VS Code's Commit UI进行提交时:
VS Code的Git似乎不接受#
不是注释的配置,因为当我检查git log
时,它仅显示第二行:
gino@myrepo$ git log
commit 1254416d309588293372b96fd1f71e30af51b1fe (HEAD -> master)
Author: ...
Date: Wed Nov 13 22:23:17 2019 +0900
These lines should be details.
当我尝试使用单行消息(#4567: blah
)时,情况更糟。提交UI不允许我提交(单击提交按钮时什么也没有发生),并且 Command Palette > Git:Commit 命令只会中止提交(可能是因为它被视为空的提交消息。
如何获取VS Code来识别自定义commentchar
设置?
注意:
- 我知道VS Code使用我的
git config
(全局或本地),因为当我尝试更改其他设置(例如user.name
)时,它会正确应用 - 它不是Start a git commit message with a hashmark (#)的副本,因为我说的是通过VS Code的Commit UI而不是通过命令行提交
- 我找不到与提交消息相关的VS Code> Git设置
- 我正在使用VS Code 1.40.0