Arthur Tarasov
Arthur Tarasov

Reputation: 3791

Nesting git repositories with .gitignore

I have three repositories: first, second, and third one inside another with a structure like this:

first
    .git
    .gitignore <- second/
    firstrepofiles
    second
        .git
        .gitignore <- third/
        secondrepofiles
        third
            .git
            thirdrepofiles

The purpose of such structure is to separate parts of the system, yet keep them connected and continuously integrated.

It seems to work just fine but I wonder is it a bad practice to do something like that?

Upvotes: 1

Views: 150

Answers (1)

bn4t
bn4t

Reputation: 1630

It would be cleaner to do this using git submodules. (https://git-scm.com/book/en/v2/Git-Tools-Submodules)

To do this, just add repo 2 and repo 3 as submodules.

Upvotes: 1

Related Questions