I am new to git so apologies if my terminologies are a bit out of whack.
I have a main repository, a Development branch from the main repository and a test data repository.
I have added test data as a sub module in the main repository so that I can access the contents of test data in my main repository.
Will the sub module added in main be reflected in Development if I pull the changes from Main to Development?
If not, is it possible to add a sub module in a branch or can it be done only at the repository level?
Will the sub module added in main be reflected in Development if I pull the changes from Main to Development?
Yes. When you merge main
branch to development
branch all the changes of main will come to development as well.
is it possible to add a sub module in a branch or can it be done only at the repository level?
Git
tracks the changes you make in that particular branch
. Not possible to make repository level changes. If you want that changes to reflect in all the branches, then make the change in the master
or the main branch which you are using and merge that branch into all the other branches you are working on.
How to merge a branch1 to branch2? Run the following commands:
git checkout branch1
git merge branch2