是否有可能用bazaar,mercurial或git做一个部分克隆/分支? [英] Is it possible to do a partial clone/branch with either bazaar, mercurial or git?

查看:114
本文介绍了是否有可能用bazaar,mercurial或git做一个部分克隆/分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个源代码管理项目,有很多子目录,其中很多目前我不需要。



我想创建一个工作拷贝只包含整个树的一部分,它仍然保留修改,提交和推回的能力。



这是可能的吗?如果是这样,我怎么能做到这一点?



我仍在决定是否要去市集或mercurial,所以对这两个问题的答案都会有所帮助。
$ b

编辑:实际上,git的解决方案也是有用的。

解决方案

如果你已经有了一个仓库,并且你想这样做,那将是一件痛苦的事。



如果你要这样做全新的版本库,您可能需要查看Mercurial新的 subrepos



基本上,您创建了标准特定目录的一个存储库:

  myproject / 
.hg /
源代码/
...文件在这里...
文件/(subrepo)
.hg /
...文件在这里...
graphics /(subrepo)
。 hg /
...这里的文件...

这会隔离不同的项目在不同的存储库中。 包含回购(在这种情况下是myproject)会跟踪每次提交时subrepos的修订版本。我提到的subrepo wiki页面解释得很好。


Suppose I have a project in source control with a lot of subdirectories, many of which I don't need at the moment.

I would like to create a working copy containing only some of the entire tree, which still maintaining the ability to make changes, commit them, and push them back up.

Is this possible and if so, how can I do it?

I'm still deciding whether to go with bazaar or mercurial, so answers regarding either of those would be helpful.

Edit: Actually, solutions for git would be useful too.

解决方案

If you already have a repository and you'd like to do this, it's going to be a pain.

If you're going to be doing this with brand new repositories, you might want to look at Mercurial's new subrepos.

Basically you create standalone repositories for certain directories:

myproject/
    .hg/
    source code/
        ... files here ...
    documentation/ (subrepo)
        .hg/
        ... files here ...
    graphics/ (subrepo)
        .hg/
        ... files here ...

This isolates the different pieces of the project in different repositories. The "containing" repo (myproject in this case) keeps track of what revision the subrepos are at every time you commit. The subrepo wiki page I mentioned explains it well.

这篇关于是否有可能用bazaar,mercurial或git做一个部分克隆/分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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