ImaginaryX
ImaginaryX

Reputation: 41

git Best Practice Recommendation

I am looking at setting up git repositories but am coming from a background in SVN.

Here is what I want:

Product Repositories - These capture stand alone individual products (an application, a library for example)

Project Repositories - These capture aggregations of products to form a solution for a particular customer.

Each project will be built up of different combinations of products. For example, Project X is built up of Application A, Application B, and then some project specific code. Project Y is build up of Application B, Application C, and Application D with project specific code and settings. You get the idea.

In SVN, the project repositories would use SVN-externals to include a version of the products.

Can I accomplish this with the repository concept I detailed above or should I be thinking of a completely different technique given the power of git?

Upvotes: 4

Views: 311

Answers (2)

user1820956
user1820956

Reputation:

Consider using Git Submodules. Details can be found in Submodules chapter of the free online Git book. Quoting from the book:

Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.

Upvotes: 3

Chris Maes
Chris Maes

Reputation: 37712

in my company we ran into the same problem. We solved this be rethinking the way our repositories were structured and used. In particular:

  • common code became shared libraries
  • we started using a package managment system (rpm) which allowed to introduce dependences. eg: project X has its own files, but also depends on package A and library C

Upvotes: 1

Related Questions