Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:32:22+00:00 2026-06-08T08:32:22+00:00

I have several sites that use Drupal, I have several servers, live, dev1, dev2…

  • 0

I have several sites that use Drupal, I have several servers, live, dev1, dev2…

Drupal’s codebase repo is big (112Mb), so I’m keen to make the most of git’s hard-linking abilities so that each time I add a site it’s not duplicating this.

So on, say, the live server I have a bare master repo, and all my sites are clones of this, each using a different branch. This is great on the one server, hard links are used, it’s fast and efficient.

But on my dev servers, they typically all clone from the bare master repo, which means two sites on the same machine can’t use hard links to save space.

What I’d like to do is set up a mirror of the bare repo on each of my dev servers, and then clone from that.

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

All good so far. But I want the mirrors to stay in sync at all times. So I used post-receive hook on dev1’s mirror to do git push --mirror origin. Now if site1 on dev1 pushes commits, they are magically pushed to the master-bare-repo.

But what if I make a change on the live server, and push that? I can’t set up a post-receive hook to push to the other(s) because that would presumably trigger their post-receive hooks which would end up in recursion?

Is there some clever way around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:32:24+00:00Added an answer on June 8, 2026 at 8:32 am

    First of all, you won’t end up in a recursion, since the post-receive hook isn’t executed when “Everything is up to date” (as noted in this other question), which will be the result of the pushes from the mirrors to the live server.

    On the other hand, that’s not all of a scalable design (every time you add a new mirror, you’ll need to change your live server’s hook to add a site to push). You’ll probably find more elegant to use a “lazy” sync strategy in your mirrors: when they receive a push they don’t just push to the master, but before that they fetch/pull from the master. This way you don’t need to setup a hook in the master and synchronization strategy will be completely managed by mirrors. The downside of this strategy is that you might eventually want to make a change to the live server that you want to be propagated to the mirrors before they need to push any change. So you have to ponder whether changes to your masters will be so critical to compensate the trade-off in scalability. Of course, a patch to make this “scalable” design also “synchronizable” is by using an external cron job to check periodically for changes in master, as suggested in comments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have several sites that use Forms Based authentication (FBA) within SharePoint. Many of
I have a program that I use on several sites. It uses require('config.php'); to
I have several sites that I want to link back to the main site
I have created an API that is used on several sites. The client sites
I have created a webapplication that exists on several sites and if I want
I have several different numbers in a group that range in sizes and would
Another lame question So, I have a site that displays several students' requests to
I have several sites where users can send me email through an html form
I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org
I have seen several sites where these social share buttons looks perfectly horizontal aligned.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.