Git 在bat中查找或查找
我想查找Git 在bat中查找或查找,git,batch-file,cmd,Git,Batch File,Cmd,我想查找git diff--name only并只选择特定扩展名的文件 我试过了 git diff——仅名称%CURR_COMMIT%..%LAST_COMMON_COMMIT%| findstr/i/e.ext>test.txt Findstr似乎不支持Unicode。 也试过 git diff--name only%CURR_COMMIT%..%LAST_COMMON_COMMIT%| find/i.ext>test.txt 也不行 然而,这起了作用 键入src.txt | find/i“.
git diff--name only
并只选择特定扩展名的文件
我试过了
git diff——仅名称%CURR_COMMIT%..%LAST_COMMON_COMMIT%| findstr/i/e.ext>test.txt
Findstr似乎不支持Unicode。
也试过
git diff--name only%CURR_COMMIT%..%LAST_COMMON_COMMIT%| find/i.ext>test.txt
也不行
然而,这起了作用
键入src.txt | find/i“.ext”>test.txt
type src.txt | findstr/i/e.ext>test.txt
findstr
不支持Unicode。
我设法通过指定find
full path使其工作,显然使用了错误的find
命令
git diff--name only%CURR_COMMIT%..%LAST_COMMON_COMMIT%|%windir%\system32\FIND.exe/i.ext>test.txt
如果你有可以工作的代码,有什么问题吗?1)它不能与Unicode一起工作。2) 用git diff的输出创建临时文件是不方便的。那么git diff…|更多|查找…
?我建议使用%SystemRoot%
而不是%windir%
。默认情况下,系统PATH
环境变量还包含%SystemRoot%\System32
作为第一个文件夹路径。我建议您使用“%\uuuuuuu APPDIR\uuuuuu%”
而不是%SystemRoot%\System32\
。