git状态——不要显示无路径的文件 - git status - don't show untracked files

- 此内容更新于:2016-02-03
主题:

有一个选项来无路径的文件不会显示?我试过,但隐藏的一切,告诉:“没有提交,工作目录清洁”甚至thouh有文件两阶段提交和提交不了。我想让它只显示文件进行提交和修改的跳过无路径的文件。

原文:

Is there an option to git status so that untracked files won't be shown?

I tried git status -u no but that hides everything and tells:

"nothing to commit, working directory clean"

even thouh there are files both staged for commit and not staged for commit.

I want it to show only files staged for commit and modified ones but skip untracked files.

网友:这就是。

(原文:This is what .gitignore is for.)

楼主:是的,很明显,我需要修改。gitignore,我讨厌当垃圾邮件我的控制台与无路径的文件。以为有一个快捷键的命令行。

(原文:Yes, obviously I need to modify .gitignore, I hate when git status spams my console with untracked files. thought there is a shortcut with command line.)

解决方案:
你需要:即。,没有空间,或者:
原文:

You need:

git status -uno

i.e., without the space, or:

git status --untracked-files=no
楼主:嗯,我误读了git文档,谢谢你的快速反应保罗!伟大的工作。

(原文:Huh, I misread git documentation about -u no, thank you for quick response Paul! that works great.)

网友:@codekiddy:它是一个意想不到的格式,肯定的。通常会等于,但git似乎有了不同的看法。

(原文:@codekiddy: It's a bit of an unexpected format, for sure. cmd -uno would normally be equivalent to cmd -u -n -o, but git appears to take a different view.)