Question

In my company we have a base software that gets customized for every client. Today using SVN we have a setup like this:

/trunk
/tags
    …
/branches
    /client_project_x
    /client_project_y
    /client_project_z

How would be the best way do organize this in git? Have a remote repository for each project and one for base code or having a big remote repo with several branches?

If we use a big remote repo with several branches, there's a way to clone just one branch from a remote repository?

Was it helpful?

Solution

Conceptually, there is no difference between multiple branches in one repository and branches in multiple repositories. The whole point of DVCS is to remove that distinction. You want to think of it in terms of the people who need to access and control any given branch. If it's common to every developer to access code from every client, then it's going to be easier to put them all in one central repo. You can pick which branches you want cloned or not, although cloning an entire repo is the easiest. If you need to have very different access permissions in different branches, it's preferable to create separate repos for them.

In other words, set it up in whichever way makes it easier for the development and test teams.

OTHER TIPS

Separate projects should be in separate repositories.

(It's as simple as that with git. There is no advantage and lots of potential disadvantages to keeping lots of unrelated - or loosely related - projects in a single repository either in a big tree or in separate branches.)

git was born to make the branches/merge branches so easy, so just make as branches as you want for new features, testing functionalities, work with sub-team without effecting the rest of the company! Linux for example has thousands of branches, and they are growing!

Watch this video for Linus Torvalds, that will help you a lot to understand the "in mind" values that he has while developing git.

I use several repos:

The core is in one repository, each plugin and each client have its own repository:

  • modwork (core)
  • modwork_foo (configuration for client "foo")
  • modwork_app1 (an app which can be installed for several clients)

No single file in core gets modified during the install or build process. Every client has the same core. The core contains hooks for custom methods.

I don't like to modify files in core in branches for clients. I think this gets difficult if you have more than 5 clients.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top