I have a parent git repo which contains files common to my product. Now when I deploy I will need to add customizations based on the client I'm deploying for. The customizations lie at dif开发者_JAVA百科ferent parts of the parent structure as different sub-folders (a 'feature' of the framework I'm forced to use). Is it possible to split my repo into 'parent-repo', 'client1-customization', 'client2-customization' etc.
To make it clear: My directory structure is as below:
myproject
-- .git
-- web
-- client1
-- client2
-- common
-- lib
I want it as:
myproject
-- .git
-- web
-- client1
-- .git
-- client2
-- .git
-- common
--lib
How can this be achieved?
Yes, if you use submodules. See the git community book for details.
Ayende shared some experience about this topic and recommends git subtree over submodules
see below for further reference:
- http://ayende.com/Blog/archive/2011/01/10/the-problem-with-git-submodules.aspx
- http://ayende.com/Blog/archive/2011/01/10/git-subtree.aspx
精彩评论