有没有办法摆脱git状态中恼人的帮助消息?

noo*_*der 5 git

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)
Run Code Online (Sandbox Code Playgroud)

这是运行时的一些输出git status.

我不介意"未提交更改的更改:"消息,但我不希望看到关于如何"更新将要提交的内容"等的"帮助"命令,因为它们只是添加了很多噪音.

我知道git status -s,但这不是我真正想要的.

有没有办法摆脱帮助信息?

Ani*_*pis 8

git-config文档中,您可以找到子部分的变量statusHints,advice.*其解释如下:

statusHints

显示如何从git-status(1)的输出中的当前状态开始,在git-commit(1)中写入提交消息时显示的模板中,以及git-checkout(1)显示的帮助消息中的说明当切换分支时.

所以我会假设设置

$ git config advice.statusHints off
Run Code Online (Sandbox Code Playgroud)

应该删除这些消息(对于本地存储库,--global用于此计算机上当前用户的所有存储库)