删除历史记录中的文件以节省一些空间 [英] delete files in history to save some space in mercurial

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

问题描述

好的,当我还年轻的时候,我把几个大文件(例如资源文件,dll等)放在我的水库中.我发现它的大小太大,以至于我无法轻易将其推入位桶中,

ok, when I was young, I put severial big files(like resource file, dll, etc..) in my mercurial repos. and I found the size of it is so big that I cannot easily push it into bitbucket,

是否可以删除此文件历史记录的任何方式容易?

any way to delete this files history EASILY?

我将所有这些文件放在/res和/dll路径中.

I put all those files in /res and /dll path.

这是一个解决方案,但是它将删除部分历史记录,因此也许有更好的解决方案. Mercurial删除历史记录

this is a solution, but it will delete part of the history, so maybe there is a better solution. Mercurial Remove History

推荐答案

您最好的选择是使用convert扩展名,但是警告,您将得到一个完全不同的回购.每个哈希都不同,每个克隆的人都需要删除其克隆并重新克隆.

Your best bet is to use the convert extension, but warning you'll end up with a totally different repo. Every hash will be different and every person who cloned will need to delete their clone and re-clone.

也就是说,这就是您要做的事情

That said, here's what you do:

创建一个名为filemap.txt的文件映射文件,其中包含:

Create a filemap file named filemap.txt containing:

exclude res
exclude dll

,然后运行以下命令:

hg convert --filemap filemap.txt your-source-repository your-destination-repository

例如:

hg convert --filemap filemap.txt /home/you/repos/bloatedrepo /home/you/repos/slenderrepo

这将为您提供一个全新的存储库,其中包含/res和/dll中任何文件的历史记录,但包含所有的历史记录,但是就Mercury(和Bitbucket)而言,它将是一个新的,无关的存储库.

That gets you a whole new repo that has all of your history except the history of any files in /res and /dll, but again it will be a new, unrelated repo as far as mercurial (and bitbucket) are concerned.

这篇关于删除历史记录中的文件以节省一些空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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