Probably, i misunderstood how git works, I have my directory structure as follows:
project (git-repo)
project 1 (git-repo)
project 2 (git-repo)
common scripts (git-repo)
All these folders have their own repositories where the main project can have child repositories such as project 1, project 2, child scripts. They can be submodules or subtree. The problem, the common scripts contain some of the codes that is common and essential to build both project 1 and project 2. What can be best strategy to maintain this so that each project can be independent as well as no need to keep common scripts in two places.
I just want to leave the indirect solution that I have figured out. It might be useful for others until getting other approaches.
For now, I am not able to escape not keeping the
common scriptsfolder in two places but It is okay to maintain it in one place. Following is the structure I have adopted for now,That way, I can work on the
common-scriptfrom its own repo and from each of the project I can usegit submodule foreach git pull origin masterand commit the repo so that I will have updated script in each of the dependent projects.