How to delete large files from history in mercurial?

I just created a mercury repo created from the heterogeneous ecosystems of other repositories. Before I publish it to my employees, I want to clean them as much as possible. To this end, I would like to completely remove some large old files from the story (pretend that they never existed), so the repo will be smaller.

Is this possible with mercury?

+32
version-control dvcs mercurial
Apr 11 2018-12-12T00:
source share
1 answer

Check the convert extension, especially the --filemap option.

Include by adding the following to mercurial.ini :

 [extensions] convert = 

Create a file map to exclude:

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

Then convert the repo:

 hg convert srcrepo destrepo --filemap <map> 

Please note that in Mercurial 2.1.1 there is an error causing an error with the specified command:

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

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

+35
Apr 11 2018-12-12T00:
source share



All Articles