tags:

views:

113

answers:

3

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
+5  A: 

Type this on your local commandline:

git config --global advice.statushints false
Dustin
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.
FM
Doesn’t work here with 1.6.4.4, either. Also, `man git-config` does not mention that setting at all.
Bombe
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: http://github.com/git/git/commit/edf563fbaa2ab50734db4a61e9092f25fbb5a417
Dustin
+1  A: 

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)

Peter
+1  A: 

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

knittl