Best Git Project management for Fronted and Backend Teams.
Setting up a new repository
git init
536 git remote add origin https://github.com/chapskev/frontend_backend_project.git
537 git remote -v
538 git status
539 git add .
540 git status
541 git pull
542 git pull origin master
543 git submodule add https://github.com/chapskev/frontend_app.git frontend_app
544 git status
545 cat .gitmodules



See it in action
We are going to create a branch developed for both frontend and backend and then add mock files.
cd frontend_app/
git checkout -b development
echo “Iam a fronted app “ > index.html
git add .
git commit -a -m “add new index.html file with some demo mock content”
At this point, you’ll have a rock
folder inside slingshot
, but if you were to peek inside that folder, depending on your version of Git, you might see … nothing.
Newer versions of Git will do this automatically, but older versions will require you to explicitly tell Git to download the contents of rock
:
git submodule update --init --recursive
If everything looks good, you can commit this change and you’ll have a rock
folder in the slingshot
repository with all the content from the rock
repository

Joining a project using submodules
Now, say you’re a new collaborator joining Project Slingshot. You’d start by running git clone
to download the contents of the slingshot
repository. At this point, if you were to peek inside the rock
folder, you’d see … nothing.
Again, Git expects us to explicitly ask it to download the submodule’s content. You can use git submodule update --init --recursive
here as well, but if you’re cloning slingshot
for the first time, you can use a modified clone
command to ensure you download everything, including any submodules:
git clone --recursive <project url>
How to Git push and update the Main repository and respective sub modules in the project

571 git add .
572 git commit -a -m “This commit will only commit the new three files .gitmodule backend_app frontend_app”
573 git status
574 git commit — amend
575 git push
576 git push — set-upstream origin development
Github sample module

Note You can also use the following shortcut to pull the latest changes made to your submodules and get your umbrella project to point to the last commits.
git submodule update --remote --merge

Reference