How do you remove big files from history in mercurial?

后端 未结 1 1757
轮回少年
轮回少年 2020-12-24 01:22

I have just created a mercurial repo created from a heterogeneous ecosystems of other repos. Before I publish it to my co-workers, I want to clean it as much as possible. To

相关标签:
1条回答
  • 2020-12-24 02:01

    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.

    0 讨论(0)
提交回复
热议问题