How to organize different parts of project in git repo?

How to organize different parts of project in git repo?

In a single project I have to organize multiple parts of the project. A web app written in php, api server written in nodejs and android and ios apps. Would it be good idea to separate these in to multiple repos? Or separate folders in a single git repo?

If the single modules are reasonably independent you can use git submodule to mingle the two approaches. You would end up with a single folder/repo in which a you have a folder for each sub-project. Every sub-project is a separate repository and can be used as such, but you would gain the ability to track the version of each project from the root repository as well as issuing “joint” commands to the sub-modules as in

git submodule update

or “recursive” commands, as in

git submodule foreach make

you find the documentation and some sort of tutorial online.

Here is an example of setting up a repository containing several submodules (ncs, …, test_network)

git init
git submodule add ssh://.../ncs
git submodule add ssh://.../test_network
vim Makefile #write the Makefile for the whole project
git add Makefile
git commit -i -m "Makefile added"
git submodule foreach autoreconf -i
git submodule foreach ./configure
make test