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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:17:41+00:00 2026-05-24T12:17:41+00:00

I have a bare repository on my home-server to which I push from my

  • 0

I have a bare repository on my home-server to which I push from my
laptop for backup. Due to a new router I cannot push anymore from
within my home-LAN to the home-server using the global URL (something
to do with “NAT loopback”) but need to use the local LAN address. So my
.git/config now contains two remotes for the same bare repository:

[remote "home1"]
        url = ssh://username@my.url/home/username/git_bare_repos/repo.git
        mirror = true
[remote "home2"]
        url = ssh://username@192.168.1.74/home/username/git_bare_repos/repo.git
        mirror = true

So, questions: Is this ok? Are there potential hazards/pitfalls? And is there a better way to do this, so I wouldn’t have to use different commands depending on whether I’m at home or not?

  • 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-24T12:17:42+00:00Added an answer on May 24, 2026 at 12:17 pm

    It’s ok. They’re the same repo after all.

    The only difference for you is that depending on your current location you’ll have to push/pull/etc from one remote or the other.

    Git keeps a reference for every branch, tag, remote-tracking branch, etc. In fact, they are all references to commits, and they have a file representation in .git/refs/....

    By comparing these references git knows the status of each branch, tag, etc. For example, if you compare refs/heads/master to refs/remotes/origin/master, and the branches are not sync’d, then these refs will differ. To find which one is outdated, git can just verify if the remote commit exists in the local branch, and if it does, then the remote branch is outdated. This also allows git to tell you how many commits your local branch is ahead of the remote branch, and vice-versa.

    A more in-depth explanation can be found here.

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

Sidebar

Related Questions

I have a bare repository on my server that I push to in /var/www/repos/my_project
I have a central bare repository in which a team publish (push) their commits.
I have a remote server on which I have created a bare git repository.
I have a central Git bare repository. When a push is made to that
I have a bare repository at /home/dan/repo/ and a working copy at /home/dan/www/project/ .
I currently have Git setup with a central bare repository which is accessed by
We have recently migrated to Git from SVN. We have setup a bare repository
We have a bare repository on a remote server that people can connect to
I have a remote bare git repository. A new developer cloned it, but he
I have this simple hook on /hooks/post-update inside a bare repository: #!/bin/sh git-update-server-info GIT_WORK_TREE=/home/user/apps/application-site/dev

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.