Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off the help hints in git output?

Tags:

git

I'm using git in the terminal and know most of the commands I need by heart. Therefore I would like to suppress the "help hints" in the output, i.e. all the text in parenthesis starting with (use "git ...) to make the output less verbose.

I know of the flags --short and --porcelain, but then the output is less readable on a quick glance IMHO.

Is there a way to keep the default formatting of the output but without the help text?

Example:

git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.

Changes not staged for commit:

    modified:   file1.txt
    modified:   file2.txt

Untracked files:

    untracked_file.txt

no changes added to commit 

... instead of ...

git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

    modified:   file1.txt
    modified:   file2.txt

Untracked files:
  (use "git add ..." to include in what will be committed)

    untracked_file.txt

no changes added to commit (use "git add" and/or "git commit -a")
like image 586
jost21 Avatar asked Apr 01 '19 21:04

jost21


People also ask

What does the git flag do?

By using the -a flag when committing you are telling Git to add all files that have been modified and then commit them.

What is Git_ssh_command?

Finally, GIT_SSH_COMMAND means Git 2.10+, so if your version of Git is too old, you will need to update it first. Follow this answer to receive notifications. answered Feb 20, 2018 at 5:37. VonC.


1 Answers

Git offered enabling/disabling advice by using the 'advice.*' key in the configuration. See git help config for more information. The following 14 variables exist:

advice.pushUpdateRejected
advice.pushNonFFCurrent
advice.pushNonFFMatching
advice.pushAlreadyExists
advice.pushFetchFirst
advice.pushNeedsForce
advice.statusHints
advice.statusUoption
advice.commitBeforeMerge
advice.resolveConflict
advice.implicitIdentity
advice.detachedHead
advice.amWorkDir
advice.rmHints

You can set them with git config --global advice.*. For example git config --global advice.statusHints false. Note that I have not seen a way to disable all the same time.

like image 137
somnium Avatar answered Sep 20 '22 01:09

somnium