8

Is there a way to configure Git to remove the dead wood from the git status command? Instead of this monstrosity:

# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   README
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   FB.pm
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       Foo.pl

I want only the key information:

# On branch master
# Changes to be committed:
#       new file:   README
#
# Changed but not updated:
#       modified:   FB.pm
#
# Untracked files:
#       Foo.pl

3 Answers 3

7

Type this on your local commandline:

git config --global advice.statushints false
3
  • This looks promising, but it did not work for me. The config change shows up when I run git config -l but it has no effect on the git status output. I'm running git version 1.6.1.2 on cygwin, in case that matters.
    – FMc
    Oct 8, 2009 at 5:40
  • Doesn’t work here with 1.6.4.4, either. Also, man git-config does not mention that setting at all.
    – Bombe
    Oct 8, 2009 at 9:24
  • 3
    I didn't find it in the documentation, I found it in the source code. It was added in v1.6.4.2-270-gedf563f. No docs were updated to reflect this change: github.com/git/git/commit/…
    – Dustin
    Oct 8, 2009 at 16:49
1

You can use

git diff --name-status

which will show information about modified and deleted files.

M       app/controllers/truck_def_controller.rb
M       app/models/truck.rb
M       app/views/prob_def/new_truck.haml
M       db/development.sqlite3
M       public/javascripts/truck.js
D       public/stylesheets/scaffold.css

it won't, however, mention files that haven't been added.

(source)

1

see commit status: make "how to stage" messages optional. the corresponding config property is statusHints.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.