tags:

views:

37

answers:

1

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 it will delete part of the history, so maybe there is a better solution. http://stackoverflow.com/questions/2684898/mercurial-remove-history

+3  A: 

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.

Ry4an