I am working on two different web sites, each with its own git repository. I have some generic code (PHP and JavaScript) which is common to both sites, and which I keep in a separate libs
folder on my development machine, using a symlink so that both local web sites believe that this libs
folder is at the root of the site.
I would like to manage the libs
folder with git, too. I can imagine two different approaches:
- Two remote copies of the
libs
folder, one in each site repo - A third git repository, just to manage the
libs
folder, with a way for the two remote site repos to know about the existence of thislibs
repo, so that all is tracked together.
I would appreciate help in deciding which of these two options is more reliable (or if there is an even better option). I would also be grateful for help in understanding how to set up the chosen option.