有没有办法摆脱在git状态恼人的帮助信息? [英] Is there a way to get rid of the annoying help messages in git status?
问题描述
没有为commit提交更改:
(使用git add< file> ...更新将提交的内容)
(使用git结账 - < file> ...放弃工作目录中的更改)
运行 git status
。
时的输出结果我不介意未针对提交进行更改:消息,但我不想看到有关如何更新将要提交的内容的帮助命令,因为它们只是增加了很多噪音。
我知道 git status -s
,但那不是我真正想要的。
有什么方法可以获得去掉帮助信息? 解决方案
statusHints 在git-status(1)的输出中显示如何从当前状态继续,在使用git-commit写入提交消息时显示的模板中显示指示信息 (1)和git-checkout(1)在切换分支时显示的帮助消息中。
所以我会假定设置
$ git config advice.statusHints off
应该删除这些消息(对于本地存储库,对本机上当前用户的所有存储库使用 - global
)
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)
This is some of the output when running git status
.
I don't mind the "Changes not staged for commit:" message, but I don't want to see "help" commands about how to "update what will be committed" etc, as they just add a lot of noise.
I know about git status -s
, but that's not what I really want.
Is there any way of getting rid of the help messages?
In the git-config
documentation you can find the variable statusHints
of the subsection advice.*
which is explained like this:
statusHints
Show directions on how to proceed from the current state in the output of git-status(1), in the template shown when writing commit messages in git-commit(1), and in the help message shown by git-checkout(1) when switching branch.
So I would assume setting
$ git config advice.statusHints off
should get rid of these messages (for the local repository, use --global
for all repositories of the current user on this machine)
这篇关于有没有办法摆脱在git状态恼人的帮助信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!