简体   繁体   English

SVN可以做到这一点还是我应该搬到Git

[英]Can SVN do this or should i move to Git

We have an in-house CMS, and currently we check out the base copy of this, and resubmit as a new repo and make changes to it. 我们有一个内部CMS,目前我们签出该内容的基本副本,然后重新提交为新的仓库并对其进行更改。 if these changes are to the core we have to copy the files over to the base copy, or if we make copies to the core we have to copy the changes to each project. 如果这些更改是针对核心的,则必须将文件复制到基本副本,或者如果将副本复制到核心,则必须将更改复制到每个项目。

what we are trying to do for a new project is: 我们正在为一个新项目尝试做的是:

  1. check out a copy of the base project 签出基础项目的副本
  2. check it in as a new repo 作为新仓库签入
  3. make any project specific changes to the #2 对项目2进行任何项目特定的更改
  4. make any core changes to the basecopy and update the copies we checked out from that 对基本副本进行任何核心更改,并更新我们从中检出的副本

so 1 base, multiple repos from the base, update the base and push the updates to the repos. 所以1个基础,基础上有多个存储库,更新基础并将更新推送到存储库。

But we dont want the base to be updated from the respos we made from it. 但是我们不希望从我们从中获得的仓库更新基地。

is this possible? 这可能吗?

===== update ===== =====更新=====

after doing more googeling, can i use the branching feature in svn to do this? 做更多的糊后,我可以使用svn中的分支功能来做到这一点吗?

have each new project branch out from the base, that way if we need to push changes from base to all the projects we can still do it. 让每个新项目都从基础分支出来,这样,如果我们需要将基础上的更改推向所有项目,我们仍然可以做到。 And we can make project specific changes to each of the branches. 我们可以对每个分支进行项目特定的更改。

Yes, you can do that. 是的,你可以这么做。 It is called svn:externals property. 它称为svn:externals属性。

So create separated repository for core files only and plug it in to your other project as an external one. 因此,仅为核心文件创建单独的存储库,并将其作为外部项目插入到其他项目中。

Hmm, sounds like a job for a DVCS like Git or Mercurial. 嗯,听起来像是Git或Mercurial这样的DVCS的工作。 Not so much that DVCS is better here, but that the current available implementations handle branching and merging better than SVN in my experience. 并不是说DVCS在这里更好,但是以我的经验,当前可用的实现比SVN更好地处理了分支和合并。 With Git or Mercurial you can setup nice intra-repository merges, no hierarchy enforced. 使用Git或Mercurial,您可以设置不错的存储库内部合并,而无需执行任何层次结构。 But mainly from your requirement of not updating the base with certain changes from the copies (so seems you want selective updates). 但是主要是因为您需要不使用副本中的某些更改来更新基础(因此您似乎需要选择性的更新)。

Yes SVN could do it. 是的,SVN可以做到。 Maybe if you never commit the changes to your "new repo" to the base. 也许您永远不会将对“新仓库”的更改提交给基地。

On the contrary, with a DCVS, it is very flexible how you push what, when and where. 相反,使用DCVS时,您可以很灵活地推动内容,时间和地点。 :) :)

EDIT: I knew little about svn:externals, check zerkms answer as it seems to fit. 编辑:我对svn:externals知之甚少,请检查zerkms的答案,因为它似乎合适。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM