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

  • Home
  • SEARCH
  • 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 6200337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:20:52+00:00 2026-05-24T04:20:52+00:00

I have three remote repository sitting on different remote servers. Server A, Server B

  • 0

I have three remote repository sitting on different remote servers.

Server A, Server B and Server C

I want to push my work to Server A, and also use the post-receive hook on server A to automatically execute a GIT pull from Server B and C to updated their repository as well at the same time.

  • 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-05-24T04:20:54+00:00Added an answer on May 24, 2026 at 4:20 am

    If I read your question correctly, the only purpose of Server B and Server C is to backup Server A, right?

    In that case, you don’t have to tell Server B and Server C to pull from A, instead push from A to B and C. So the content of your post-receive hook would be

    git push --mirror server_b
    git push --mirror server_c
    

    assuming that server_b and server_c are known remotes on A. See the docs of git push for a description of the --mirror flag.

    If you want B and C to become the active part, set up a cron job to git fetch A periodically.


    Another approach is to define a remote in your local repo that has three URLs:

    [remote "multi"]
    url = server_a/repo.git
    url = server_b/repo.git
    url = server_c/repo.git
    

    Now, when you usually push your work to A using git push, simply do a

    git push --mirror multi
    

    to push all your local on A, B and C at the same time.


    Another question is: why do you push to B and C at all? It seems as you are doing it just for backup reasons. Do you know that every repo (your working copy, that one on A, …) contains a full history of your development? It’s not like SVN where you have one central history. Git is a DVCS and every working copy has a full history.

    So, using Git, your history will only get lost if all repos get destroyed at the same time. Otherwise, you’ll always have at least one repo that contains your project history. See also the introduction chapter on Pro Git for some notes about that.

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

Sidebar

Related Questions

I have switched our internal codebase to use Mercurial, with a hosted remote repository.
I have three TextBox controls on the page <asp:TextBox ID=TextBox1 runat=server AutoPostBack=True OnTextChanged=TextBox_TextChanged TabIndex=1>
I have a remote git server that has been working great for months. Earlier
I have a remote web server that I have full access to (ssh, git,
I have created a repository on https://bitbucket.org/ and use TortoiseHg to clone it to
We have 2 physical servers, one the first one we have Windows Server 2008
In short: Is there any known protocol for remote process management? I have a
I have an array in Perl: my @my_array = (one,two,three,two,three); How do I remove
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page

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.