开发者

Can 'git status' be configured so that it won't provide help text?

开发者 https://www.devze.com 2022-12-08 04:08 出处:网络
Is there a way to configure Git to remove the dead wood from the git status command? Instead of this monstrosity:

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


Type this on your local commandline:

git config --global advice.statushints false


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)


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

0

精彩评论

暂无评论...
验证码 换一张
取 消