How do you remove big files from history in mercurial?

Check out the convert extension, particularly the --filemap option.

Enable by adding the following to mercurial.ini:

[extensions]
convert =

Create a map of files to exclude:

exclude path/to/file1
exclude path/to/file2

Then convert the repo:

hg convert srcrepo destrepo --filemap <map>

Note there is a bug in Mercurial 2.1.1 causing an error with the above command:

initializing destination destrepo repository
abort: invalid mode ('r') or filename

Just add the --splicemap <nonexistent file> option to fix the problem.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)