linux - Git #hashtags 状态
问题描述
我在两台机器之间移动,现在我所有的git status
命令输出都充满了#
我有相同的.gitconfig
和.bashrc
文件。
还测试了制作一个新的 git clone,同样的情况。
在我的旧电脑上看起来很正常:
On branch xxx
Your branch is up to date with 'origin/xxx'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: xxx
在我的新电脑上,它充满了“评论”:
# On branch xxx
# Your branch is up to date with 'origin/xxx'.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: xxx
如何删除这些标签?
解决方案
默认情况下,较旧的 git 版本仅打印在行#
的前面。git status
它在较新的版本中被删除。
status: 默认不显示'#'注释前缀
从历史上看,“git status”需要在每个输出行前加上“#”,以便可以将输出作为注释添加到提交消息中。当从命令行运行“git status”时,此前缀注释没有实际用途,这可能会分散用户对真实内容的注意力。
默认禁用此前缀注释,并使其对需要向后兼容 status.displayCommentPrefix 的用户重新激活。
显然,“git commit”在写入 COMMIT_EDITMSG 时会忽略 status.displayCommentPrefix 并无条件地保留注释(但在写入 stdout 以获取错误消息或使用 --dry-run 时不会)。
签字人:Matthieu Moy Matthieu.Moy@imag.fr 签字人:Junio C Hamano gitster@pobox.com
推荐阅读
- cucumber - Gherkin markdown 误解了冒号:符号
- regex - java - 如何在java中的词法分析器中标记字符串?
- javascript - 在 JavaScript forEach 函数中没有发生返回?
- c - 在这种特殊情况下,静态数组慢 700 倍是否合理?
- windows - msvc 2017 x64 寄存器保存
- mysql - SQL多行的内连接
- javascript - 在带有 Nativescript-Vue 的 v-for 中使用 fontawesome 图标时出现问题
- sql - 每个 DISTINCT 的多个 ORDER BY 和 LIMIT
- ios - 有没有办法以编程方式使用自动布局扩展为自动布局约束设置动画?
- php - Laravel 仅在一页上抛出“未定义的变量”