如何使用BFG repo clean删除一个文件夹/目录? [英] How to delete one folder / directory using BFG repo cleaner?
问题描述
如何使用BFG仅删除一个目录?
How do I delete only one directory using BFG?
帮助说:
delete folders with the specified names (eg '.svn', '*-tmp' - matches on folder name, not path within repo)
这似乎意味着--delete-folders "config"
将与存储库中任何位置的所有名为config的文件夹匹配.
Which seems to mean that --delete-folders "config"
will match all folders named config, anywhere in the repository.
推荐答案
我在这里找到了答案:从特定路径删除文件
I found the answer here: remove files from specific path
BFG的作者说不可能做到这一点,除非您使用特殊命令将给定目录的所有Blob转储到文本文件,然后使用--strip-blobs-with-ids并提供该文本文件.
The author of BFG says it can't be done, unless you use a special command to dump all blobs for a given directory to a text file, and then use --strip-blobs-with-ids and provide that text file.
[更新] 这对我不起作用.我运行命令:
[UPDATE] This doesn't work for me. I run the command:
git log --format=%H -- cms/assets/ | xargs -IcommitId git rev-parse commitId:cms/assets/
我得到了8个Blob ID的列表.我将它们放在文本文件中,然后执行bfg -bi ~/tmp/blob-ids
,然后BFG退出并说:BFG aborting: No refs to update - no dirty commits found??
I get a list of 8 blob ids. I put those in text file, then I exec bfg -bi ~/tmp/blob-ids
, and BFG exits saying: BFG aborting: No refs to update - no dirty commits found??
这篇关于如何使用BFG repo clean删除一个文件夹/目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!