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 8022175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:11:36+00:00 2026-06-04T22:11:36+00:00

Here is the situation. I have a remote git repository on Server A. Also,

  • 0

Here is the situation. I have a remote git repository on Server A. Also, I have to work on Desktop B with the same source code in this repository. Because of the limited bandwidth to access Server A, I’d like set up a local mirror on Desktop B for the repository.

Now, I have set up the mirror repository by

git clone --mirror https://repository-on-server-a /local/repo/path.git

I have tested the local repository by

git clone file://localhost/local/repo/path.git

Then I modified crontab to do

cd /local/repo/path git fetch -q

to sync up every 5 mins. It works well.

At the beginning, I was thinking about using

git config --global url.file://localhost/local/repo/path.git.insteadOf https://repository-on-server-a

to have git fetch all objects from local directory instead of a remote repo. However, it doesn’t work.

My question is

  1. Is there a simple way to set up such local mirror for a remote git repo?
  2. How to handle ‘git push’? Since the insteadOf will get every push into local directory, how could I push all my changes back to Server A?

The local directory is for a test but not the final solution. I will have another Desktop C to get source code from Desktop B later. Another colleague will join me too. That means we want to put all changes in Desktop B to have some ‘centric’ solution for us.

  • 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-04T22:11:37+00:00Added an answer on June 4, 2026 at 10:11 pm

    What’s the mirror for? Your local git working directory already is a mirror of the origin repository; that’s how DVCSes work. I don’t understand the benefit of a second local copy on your filesystem.

    EDIT
    If you want to use one of your repos as a local-network collection point for changes between the rest of your network and the upstream origin, then the cron job is fine. Just have it do a push --mirror after it does its fetch -a.

    However, I wouldn’t bother with the proxy/alias setup. Just have everyone clone from and push to your local mirror explicitly; that way it won’t get in the way if they need to get to the real origin for some reason. They can even set both URLs as remotes, use the local one by default, and have the real one available by remote name if needed.

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

Sidebar

Related Questions

So here is the situation. I have a database on a remote server that
Here's the situation: I have a public repository for my open-source app on github.com.
Hi this may seem like a weird question, but here's my situation: I have
Here is the situation. This small company I'm working with wants to have a
Here's the situation... I need to be able to rebase a git repository branch
Here's the situation. I have a primary web server that needs to be able
Here is my situation. I have an application (Mirth Connect) running on the same
Here is the situation : we have to offer a customer with a web-based
Here is my situation: I have one table that contains a list of drugs
here's the situation: I have a where in every cell all the area has

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.