How to use hg convert properly

谁说我不能喝 提交于 2019-12-08 10:45:22

问题


at one point I committed large files to my hg repository, I later did a hg forget on these files, but now my repository is quite big and on every new clone it takes ages as these files are still being pulled down as part of the history.

I am using this SO post to try and convert my repository into a repository that doesn't know of the large files. I am doing the following

assume my repository has the following structure:

~/workspace/
    project/
        data/
            large_file.txt
        src/
            ...

I am doing the following

cd workspace/project
echo data/large_file.txt >> /tmp/myfilemap
hg convert --filemap ~/workspace/project ~/workspace/new_repo

However the new_repo just appears to be empty.

Am I doing something wrong?


回答1:


The convert action operates within the working directory so you probably don't want to start the operation from in there.

The command format is as follows:

hg convert --filemap filemap_path SourceRepoPath TargetRepoPath

You can use relative paths, but put the filemap outside the repos.

Your filemap contents should be formatted like so:

exclude "data/large_file.txt"


来源:https://stackoverflow.com/questions/29231136/how-to-use-hg-convert-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!