如何在 .gitignore 文件中添加注释?
您可以在 .gitignore 文件中写入注释吗?
如果是这样,该行前面是否应该带有 #
或其他指示符?
Can you write comments in a .gitignore
file?
If so, should the line be preceded with a #
or some other indicator?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您可以在那里发表评论。然而,它们必须从一行的开头开始。
参见https://git-scm .com/book/id/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring
[...]
注释字符为
#
,例如:Yes, you may put comments in there. They however must start at the beginning of a line.
cf. https://git-scm.com/book/id/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring
[…]
The comment character is
#
, example:执行
git help gitignore
。您将获得包含以下行的帮助页面:
Do
git help gitignore
.You will get the help page with following line: