Reputation: 123
I have created a React project using create-react-app
for my front-end team.
The team is divided into 2 in terms of functionality. How can each team have their own git repository with their own functionality and the final app is combined in the end?
We tried submodules
but it didn't work as expected.
Upvotes: 0
Views: 1416
Reputation: 830
At first it is useful to clear usage of submodules in git. According to official git documentation.
It often happens that while working on one project, you need to use another project from within it.
Q: If your sub-projects individually are meaningful, you must use submodules (as an example each part is a library/project which can uses in several projects). I think this is not your case!
What this link noted is a suggestion to use as workflow. Before using that it is useful to clear the branch usage in git. For an in detailed description you can read this link, but your case is this: Every team(even every body) can develop its code on a branch and save its changes as sequential commits on that. At last you can merge that branch to another one to apply all changes on target branch. So in your case each develop team can use its own branch(example frontend_1
, frontend_2
or backend
branches). Finally they can merge their branches on master
to integrate their code. All of these done in a single repository(without submodules).
Note: If during the development one file modified at the same time in two different locations, it cause conflict and must resolve manually. This is not respect to submodules or workflow. This may occur on pull
, rebase
or even merge
process.
Upvotes: 1