使用 bazaar 删除文件历史记录 [英] delete file history with bazaar

查看:73
本文介绍了使用 bazaar 删除文件历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人将所有二进制文件提交到我们的 bazaar 主干,我想摆脱它.`bzr del file' 只从当前修订版中删除文件,而不是文件的历史记录.

Someone committed all binaries to our bazaar trunk, and I want to get rid of it. `bzr del file' only deletes the file from the current revision, but not the history of the file.

有没有办法可以删除文件历史记录,这样我们就不必下载数百 MB 的数据?

Is there a way we can remove the file history so that we don't all have to download hundreds of MBs of data?

推荐答案

有 2 种方式.但是您需要准备好重新创建部分(甚至完整)分支历史记录,因此删除文件后,您当前(本地)的分支将与新分支不兼容.

There is 2 ways. But you need to be ready that you will re-create the part (or even full) of your branch history, so your current (local) branches will become incompatible with new branch after deleting the file.

1) 手动方式.您可以在添加大文件之前创建分支的副本以进行修订.然后您需要半手动重新提交您的进一步修订并排除大文件.使用 bzr-rewrite 插件(以前的 bzr-rebase)中的 replay 命令来重放那些没有对大文件进行更改的修订版.并使用 merge -cN 进行大文件更改的修订,手动删除这些文件并提交.因此,您将保持大部分历史记录完整无缺,并为您分支的其他文件保留唯一的文件 ID.

1) Manual way. You can create a copy of your branch to revision just before big files have added. Then you need semi-manually re-commit your further revisions and exclude big files. Use replay command from bzr-rewrite plugin (former bzr-rebase) to replay those revisions where no changes to big files present. And use merge -cN for revisions where changes to big files are present, manually delete these files and commit. Thus you will keep most of your history intact and will keep unique file ids for other files of your branch.

2) 使用 bzr-fastimport 插件将您的历史记录导出为使用 bzr fast-export 命令的快速导入流.然后用 bzr fast-import-filter -x FILE 命令过滤掉大文件.最后使用 bzr fast-import 命令重新创建没有大文件的新分支.这种方法会破坏你所有的历史记录,你的所有文件都会得到新的文件 id,所以你的新分支将与旧分支完全不兼容.

2) Use bzr-fastimport plugin to export your history as fast-import stream with bzr fast-export command. Then filter out big files with bzr fast-import-filter -x FILE command. And in the end re-create new branch without big files with bzr fast-import command. This method w3ill destroy all your history and all your files will get new file ids, so your new branch will be totally incompatible with old branch.

无论如何,如果您有包含大文件历史记录的共享存储库,您需要创建新的空共享存储库并将新的过滤分支放在那里.

In any case, if you have shared repository with big files history inside you need to create new empty shared repository and put your new filtered branch there.

这篇关于使用 bazaar 删除文件历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆