开发者

delete files in history to save some space in mercurial

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?

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

edit:

this is a solution, but i开发者_如何学编程t will delete part of the history, so maybe there is a better solution. Mercurial Remove History


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:

Create a filemap file named filemap.txt containing:

exclude res
exclude dll

and then run this command:

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

For example:

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

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜