我想在一组路径中检索文件的路径、权限和内容哈希列表以进行修订,不包括某些路径。
git ls-tree
看起来很完美。例如,在 Git 存储库中,
$ git ls-tree -r v2.2.2 -- Documentation ':!Documentation/RelNotes'
100644 blob ddb030137d54ef3fb0ee01d973ec5cee4bb2b2b3 Documentation/.gitattributes
100644 blob 2c8b2d612ee0d6c1f687bfa062bb7fe6471d9280 Documentation/.gitignore
100644 blob 894546dd75416fcf09542096a67b2f22a7d0de7a Documentation/CodingGuidelines
100644 blob 2f6b6aabd74a24abdb3ac189118095fcee19f8d2 Documentation/Makefile
100644 blob fa71b5f0b62f43483d02c24d809e6282fa49576a Documentation/SubmittingPatches
100644 blob 2c16c536ba830ec12bbf335d09f689d23e325197 Documentation/asciidoc.conf
100644 blob 0cebc4f6927211ffbc013de9368f03f480dba65d Documentation/blame-options.txt
100755 blob ba4205e0302a267a5da6bef504f3e69eb0c4aa6d Documentation/build-docdep.perl
100755 blob 87437f8a95768595e040b8c4c1d48e5c29ada087 Documentation/cat-texi.perl
但这已在 2.3.0中删除,并带有消息
ls-tree:禁用负路径规范,因为它不受支持
那是循环的;)
在 git 2.3.0 及更高版本中执行此操作的新“正确”方法是什么?