开发者

is there a 'git find'?

开发者 https://www.devze.com 2022-12-27 01:48 出处:网络
Is there a git find analogue of git grep, i.e., something that will find a filename by pattern in the tree? I\'ve gone through a lot of git documenta开发者_StackOverflowtion and not found this, but I\

Is there a git find analogue of git grep, i.e., something that will find a filename by pattern in the tree? I've gone through a lot of git documenta开发者_StackOverflowtion and not found this, but I'm having a hard time believing it doesn't exist somewhere.


You can list all files in a tree object using git ls-tree -r --name-only --full-tree <treeish>. Pipe this through a regular grep to find what you're looking for.


Try git-ls-tree and run the output through grep(1)


It's simply:

git ls-files 'yourpattern'
0

精彩评论

暂无评论...
验证码 换一张
取 消