Search code examples
gitgit-submodulesatlassian-sourcetreegit-subtree

How to organize source control for many subprojects?


I am creating a website with web apps within it. I am now at the stage where I am using phonegap to turn the web apps into mobile apps, but for that I need to make a branch for each app which has the app's directory as the root.

How do I go about creating a branch with a sub directory as the root?

root directory
-> app 1
-> app 2

Solution

  • A branch doesn't work that way. If you want separate source control for each app, you should create a separate repository for each app.

    If those subdirectories are a part of a larger project, should be versioned togeter and there's no way to separate them, use git-submodules. There's a git-subtree command to help you. But that is a more difficult concept which requires some experience with git, so use separate repos if you can.