简体   繁体   English

Git #hashtags 状态

[英]Git #hashtags in status

I moved between two machines and now all my git status commands outputs are filled with #我在两台机器之间移动,现在我所有的git status命令输出都充满了#

I have the same .gitconfig and .bashrc files.我有相同的.gitconfig.bashrc文件。

Also tested making a new git clone, same happens.还测试了制作新的 git 克隆,同样情况。

On my old computer it looks normal:在我的旧电脑上看起来很正常:

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 my new computer it's full of "comments":在我的新电脑上,它充满了“评论”:

# 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

How do I remove those tags?如何删除这些标签?

Older git versions just printed # in front of the lines in git status by default.较旧的 git 版本默认在git status的行前打印# And it was removed in newer version.它在较新的版本中被删除。

See https://github.com/git/git/commit/2556b9962e7c0353d562b7bf70eed11d8f29d0b0#diff-21ecaaf4e2318a39cdedf505941dbfbabd3329f041c839a03fb84906b4dae4fb this commit.请参阅https://github.com/git/git/commit/2556b9962e7c0353d562b7bf70eed11d8f29d0b0#diff-21ecaaf4e2318a39cedf505941dbfbabd33329f041c83b4dde9a提交。

status: disable display of '#' comment prefix by default status: 默认不显示'#'注释前缀

Historically, "git status" needed to prefix each output line with '#' so that the output could be added as comment to the commit message.从历史上看,“git status”需要在每个 output 行前加上“#”,以便可以将 output 作为注释添加到提交消息中。 This prefix comment has no real purpose when "git status" is ran from the command-line, and this may distract users from the real content.当从命令行运行“git status”时,此前缀注释没有实际用途,这可能会分散用户对真实内容的注意力。

Disable this prefix comment by default, and make it re-activable for users needing backward compatibility with status.displayCommentPrefix.默认禁用此前缀注释,并使其对需要向后兼容 status.displayCommentPrefix 的用户重新激活。

Obviously, "git commit" ignores status.displayCommentPrefix and keeps the comment unconditionnaly when writing to COMMIT_EDITMSG (but not when writing to stdout for an error message or with --dry-run).显然,“git commit”在写入 COMMIT_EDITMSG 时会忽略 status.displayCommentPrefix 并无条件地保留注释(但在写入 stdout 以获取错误消息或使用 --dry-run 时不会)。

Signed-off-by: Matthieu Moy Matthieu.Moy@imag.fr Signed-off-by: Junio C Hamano gitster@pobox.com签字人:Matthieu Moy Matthieu.Moy@imag.fr 签字人:Junio C Hamano gitster@pobox.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM