如何仅显示当前目录中未跟踪的文件(忽略子目录)?

Leo*_*yev 10 git

git ls-files --others
Run Code Online (Sandbox Code Playgroud)

沿着目录树下来.有没有一种简单的方法,以显示未跟踪文件在当前目录?

Von*_*onC 5

使用以下排除模式ls-files

 # on Windows, with msysgit
 git ls-files --others -x */*

 # on Unix (Cygwin or Ubuntu), quotes are necessary around the pattern
 git ls-files --others -x "*/*"
Run Code Online (Sandbox Code Playgroud)

从手册页:

-x <pattern>
--exclude=<pattern>
Run Code Online (Sandbox Code Playgroud)

跳过未跟踪的文件匹配模式。请注意,模式是外壳通配符模式。