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?
You can set them with git config --global advice. * . For example git config --global advice. statusHints false .
The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git.
The -d option is used to delete a git branch from the local machine. Note that -d is a safe option; this means that a branch will not be deleted if its changes have not been merged into the main branch.
" git status --branch --porcelain " displays the status of the branch (ahead, behind, gone), and used gettext to translate the string. Use hardcoded strings when --porcelain is used, but keep the gettext translation for " git status --short " which is essentially the same, but meant to be read by a human.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With