Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

dvcs

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
like image 713
FMc Avatar asked Oct 08 '09 04:10

FMc


People also ask

What is git status used for?

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. Status output does not show you any information regarding the committed project history.

When it is a good idea to do a git status?

When in doubt, run git status . This is always a good idea. The git status command only outputs information, it won't modify commits or changes in your local repository. A useful feature of git status is that it will provide helpful information depending on your current situation.

What is configuration in git?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.

What are the three levels to which you can apply git configurations?

# There are 3 levels of git config; project, global and system.


3 Answers

Type this on your local commandline:

git config --global advice.statushints false
like image 63
Dustin Avatar answered Oct 08 '22 18:10

Dustin


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)

like image 44
Peter Avatar answered Oct 08 '22 20:10

Peter


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

like image 39
knittl Avatar answered Oct 08 '22 18:10

knittl