I’m trying to setup a structure where I can have some shared code base across multiple projects, and need some advice on the best way to set it up.
I want to have a core set of ‘commonCode’.
Now, for different projects, I may place this code in different locations –
for example
project1
config
files
/commonCode
project2
config2
somecode
/commonCode
I also want project 1 and project 2, in addition to commonCode, source controlled.
I originally thought about doing all this in one big repository as different branches, but then couldn’t figure out an appropriate way to ‘checkout a branch into a folder’ (for example, sometimes I want commonCode in the files folder, sometimes in the somecode folder). I need this setup, so if I make changes to commonCode, I can merge it into the others.
Does anyone have any ideas on how I should set this up?
Thanks!
You could use Submodules:http://book.git-scm.com/5_submodules.html