如何正确使用汞转换 [英] How to use hg convert properly

查看:106
本文介绍了如何正确使用汞转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一次我将大型文件提交给hg存储库,后来我对这些文件进行了hg forget,但是现在我的存储库非常大,在每个新克隆上它都需要很长时间,因为这些文件仍然被删除.历史的一部分.

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.

我正在使用此 SO帖子尝试将我的存储库convert放入不知道大文件的存储库中.我正在做以下

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/
            ...

我正在做以下事情

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

但是new_repo似乎是空的.

我做错什么了吗?

推荐答案

convert操作在工作目录中运行,因此您可能不想从该目录中开始操作.

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

命令格式如下:

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"

这篇关于如何正确使用汞转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆