I have several sites that use Drupal, I have several servers, live, dev1, dev2 ...
Drupal codebase repo is large (112Mb), so I try to make the most of git hard-linking features, so every time I add a site, it does not duplicate this.
So, let's say, on a real server, I have a bare master repo, and all my sites are clones of this, each of which uses a different branch. It works fine on a single server, hard links are used, it is fast and efficient.
But on my dev servers, they are usually all cloned from the main repo server, which means that two sites on the same computer cannot use hard links to save space.
What I would like to do is install a bare repo mirror on each of my development servers and then clone from it.
dev1$ git clone --mirror live:master-bare-repo dev1-mirror-repo dev1$ git clone -b site1 dev1-mirror-repo site1 dev1$ git clone -b site2 dev1-mirror-repo site2
Everything is still. But I want the mirrors to be constantly in sync. So I used post-receive hook on the dev1 mirror to do git push --mirror origin . Now, if site1 on dev1 clicks on a commit, they are magically pushed to master-bare-repo.
But what if I make changes on the live server and push this? I can’t set up the post-receive hook to click on the other (s) because it supposedly causes their post-receive hooks to fall into recursion?
Is there any smart way?
artfulrobot
source share