简体   繁体   中英

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.

This is the current situation in SVN

I have one main project (let's call it Project0) that is the starting point. Then I have more than 100 projects (that i will call ProjectA, ProjectB, .... ProjectZ) and each of these projects is associated to one customer.

All the ProjectsA-Z are created as a branch of the Project0 at some point of its revision history. After a new ProjectX is created starting from Project0, in the ProjectX will be committed all the customizations for a particular customer.

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.

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.

The issue on 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. 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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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