我有以下内容:
$ tree
.
├── bar
│ ├── foo.js
│ ├── foo.herp
│ ├── foo.derp
│ └── foo.py
├── bar.herp
└── baz.py
我想使用以下内容
[git ls-files -- {}
其中{}
是某种形式的glob模式
并且我希望它返回
bar/foo.js
bar/foo.py
baz.py
您可以在ls文件之后提供任意数量的glob表达式:
git ls-files -- '*.js' '*.py'
不。从git版本2.20.1开始
git ls-files -- '**/*.js' '**/*.py'
将不返回任何文件
git ls-files -- '**/*.js'
将返回仓库中的所有.js文件