noobcoder noobcoder - 3 months ago 8
Git Question

Is there a way to get rid of the annoying help messages in git status?

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?

Answer

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)