문제

I have the following:

$ tree
.
├── bar
│   ├── foo.js
│   ├── foo.herp
│   ├── foo.derp
│   └── foo.py
├── bar.herp
└── baz.py

I want to use the following

git ls-files -- {} where {} is some sort of glob pattern

and I want it to return

bar/foo.js
bar/foo.py
baz.py
도움이 되었습니까?

해결책

You can provide any number of glob expressions after ls-files:

git ls-files -- '*.js' '*.py'

다른 팁

Nope. As of git version 2.20.1

git ls-files -- '**/*.js' '**/*.py'

Will return no files

git ls-files -- '**/*.js'

Will return all .js files in the repo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top