在git HEAD中查找所有二进制文件 [英] Find all binary files in git HEAD
问题描述
我有一个巨大的git repo,最终希望使用 bfg 进行清理。
但首先,我想追踪并删除 HEAD
中git视为二进制文件的文件...
因此,我在寻找的是查找 HEAD 中git视为二进制文件的所有文件。
这些都没有帮助: 预先感谢您的帮助。 打破它: I have a huge git repo that eventually want to clean up with bfg. So, what i'm looking for is a command to find all files in the HEAD that git treats as binary. These didn't help: Thank you in advance for your help. Breaking it down: 这篇关于在git HEAD中查找所有二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
diff < grep'^>'| cut -d:-f 1 | cut -d''-f 2-
git grep -c''
打印存储库中每个文件的名称和行数。添加 -I
选项会使该命令忽略二进制文件。
diff<(cmd1)< (cmd2)
使用进程替换为命名管道提供 diff
,通过该管道输出 cmd1
和 cmd2
。
grep
和 cut
命令用于从 diff
的输出中提取文件名。
But first, I want to track down and remove files in the HEAD
which git treats as binary...
diff <(git grep -Ic '') <(git grep -c '') | grep '^>' | cut -d : -f 1 | cut -d ' ' -f 2-
git grep -c ''
prints the names and line counts of each file in the repository. Adding the -I
option makes the command ignore binary files.diff <(cmd1) <(cmd2)
uses process substitution to provide diff
with named pipes through which the output of cmd1
and cmd2
are sent.grep
and cut
commands are used to extract the filenames from the output of diff
.