DouglasAdams
DouglasAdams

Reputation: 490

How to maintain repositories into a single repository

I have a repository for each micro-services ('A', 'B', ..). The structure of a repository looks like :

A
|-dockerfile
|-src
  |-Java
  |-Groovy

Since all of these repositories belongs to a project called 'WholeProject', I want to maintain a repository 'WholeProject' which looks like :

WholeProject
|-docker-compose.yml
|-µS
  |-A
  |-B
  |-..

So I could easily maintain a docker-compose file and a repository that contains all the revelant things about my project.

Is this a good idea ? How can I perform that ?

Upvotes: 3

Views: 132

Answers (1)

VonC
VonC

Reputation: 1324937

You could consider using git submodules with:

cd /path/to/WholeProject
git submodule -- /url/to/repo/A µS/A
git submodule -- /url/to/repo/B µS/B

That way, you can clone WholeProject with a:

git clone --recursive

And you get A and B at their last recorded SHA1.

Upvotes: 1

Related Questions