Best pratice for multiple custom projects and Git
Asked Answered
C

4

6

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?

Cantlon answered 4/9, 2012 at 13:17 Comment(0)
M
2

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.

Medicare answered 4/9, 2012 at 13:53 Comment(2)
How to pick which branches I want to clone?Cantlon
Look here.Medicare
C
1

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

Concavoconvex answered 4/9, 2012 at 13:25 Comment(2)
Any tip on how to manage multiple self hosted repos in a way that's easy to create a new remote repo?Cantlon
@MarcoPompei: git init --bare in a suitably accessible location is the simplest way to create a "central" shared repository.Concavoconvex
F
0

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.

Fitting answered 4/9, 2012 at 13:25 Comment(0)
I
0

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.

Irizarry answered 4/9, 2012 at 14:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.