2009-10-08 17 views
8

有沒有辦法配置Git從git status命令中刪除死木?相反,這個畸形的:可以配置'git status',以便它不會提供幫助文本?

# 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 

我只想要的關鍵信息:

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

回答

7

類型這在您的本地命令行:

git config --global advice.statushints false 
+0

這看起來很有前途,但它並不適合我。當我運行'git config -l'時,配置發生變化,但它對'git status'輸出沒有影響。我在cygwin上運行git version 1.6.1.2,以防萬一。 – FMc 2009-10-08 05:40:50

+0

也不適用於1.6.4.4。另外,'man git-config'完全沒有提到這個設置。 – Bombe 2009-10-08 09:24:17

+3

我沒有在文檔中找到它,我在源代碼中找到它。它是在v1.6.4.2-270-gedf563f中添加的。沒有文檔更新以反映此更改:http://github.com/git/git/commit/edf563fbaa2ab50734db4a61e9092f25fbb5a417 – Dustin 2009-10-08 16:49:02

1

您可以使用

git diff --name-status 

這將顯示有關的信息修改和刪除的文件。

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 

但是,它不會提及沒有添加的文件。

source

相關問題