简体   繁体   English

从 SVN 切换 Git 上处理多个项目的最佳方法是什么?

[英]Which is the best way to handle multiple projects on Git switching from SVN?

We are considering switching all the projects in my company from SVN to Git, but I'm afraid that it will be a problem.我们正在考虑将我公司的所有项目从SVN切换到Git,但恐怕会出问题。

This is the current situation in SVN这是SVN中的当前情况

I have one main project (let's call it Project0) that is the starting point.我有一个作为起点的主要项目(我们称之为 Project0)。 Then I have more than 100 projects (that i will call ProjectA, ProjectB, .... ProjectZ) and each of these projects is associated to one customer.然后我有 100 多个项目(我将其称为 ProjectA、ProjectB、.... ProjectZ),每个项目都与一个客户相关联。

All the ProjectsA-Z are created as a branch of the Project0 at some point of its revision history.所有的 ProjectsA-Z 都是作为 Project0 在其修订历史的某个时间点的一个分支而创建的。 After a new ProjectX is created starting from Project0, in the ProjectX will be committed all the customizations for a particular customer.从 Project0 开始创建新的 ProjectX 后,将在 ProjectX 中提交特定客户的所有定制。

It happens all the time that there are some commits that are merged from ProjectX to Project0, and some other times that some commits are merged from Project0 to ProjectX.总是有一些提交从 ProjectX 合并到 Project0,而在其他时候,一些提交从 Project0 合并到 ProjectX。

Each developer of the company usually works only on a few projects (for example on ProjectsA, ProjectB and on Project0) so it doesn't need to download all the projects to work on his workstation.公司的每个开发人员通常只在少数项目上工作(例如在 ProjectsA、ProjectB 和 Project0 上),因此无需下载所有项目即可在他的工作站上工作。

The issue on Git Git 上的问题

The issue that I see on Git is that we would need to create one single repository for Project0, and then have all the other ProjectsA-Z as branches of Project0.我在 Git 上看到的问题是我们需要为 Project0 创建一个存储库,然后将所有其他 ProjectsA-Z 作为 Project0 的分支。 This is an issue because for my undestanding, even if I need to work on ProjectX, then I will need to download the whole repository (that contains all Project0, and ProjectsA-Z), that could be very large.这是一个问题,因为我不明白,即使我需要在 ProjectX 上工作,我也需要下载整个存储库(包含所有 Project0 和 ProjectsA-Z),这可能非常大。

Is there a different way to organize the workflow in Git in order to be able to do the same things that we are doing now?是否有不同的方法来组织 Git 中的工作流,以便能够做我们现在正在做的事情? One way would be to create a new repository for every Project AZ, but then I didn't find an easy way to merge a single commit from or to Project0.一种方法是为每个项目 AZ 创建一个新的存储库,但后来我没有找到一种简单的方法来合并来自或合并到 Project0 的单个提交。

Your understanding is mostly correct.你的理解大多是正确的。 But unless you are storing big binary blobs, git is very space-efficient and what you are afraid of probably won't be an issue.但除非您存储大二进制 blob,否则 git 非常节省空间,您担心的可能不会成为问题。 For each project, only the modifications of that project vs. the base project need be transferred and stored and even those will be efficiently compressed.对于每个项目,只需要传输和存储该项目与基础项目的修改,甚至那些将被有效压缩。

If you are storing and frequently modifying many or huge binary blobs this might become an issue.如果您要存储并经常修改许多或巨大的二进制 blob,这可能会成为一个问题。 In that case, you can change the fetch config of your clients so they only fetch the branches they need instead of all of them, but that might be a bit involved if you are just starting with git.在这种情况下,您可以更改客户端的获取配置,以便它们只获取他们需要的分支而不是所有分支,但如果您刚开始使用 git,这可能会有点涉及。

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

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