10

Possible Duplicate:
How to change a remote repository URI using Git?

I have 2 remote repos

remotes/origin/develop
remotes/origin/master

Originally these were on ip-address-1. The ip address has changed to new-ip-address-2.

How can I change my local references so I can access the same repo at a new ip address?

Community
  • 1
  • 1
csi
  • 9,018
  • 8
  • 61
  • 81
  • 1
    If you use a DNS name rather than an IP address for your Git URL, you won't run into this kind of issue. You can edit the URLs in .git/config. – Eric Walker Dec 17 '12 at 00:25
  • 2
    Change it in the .git/config file of your projects root directory. – thescientist Dec 17 '12 at 00:45
  • @vcsjones is correct... what is the proper thing to do on my side? delete? answer with same answer? close? Thanks. – csi Dec 17 '12 at 01:40
  • @ChristopherIckes Flag it as a dupe to that link. Either the community will close it as a duplicate or a diamond mod will do it. – vcsjones Dec 17 '12 at 01:42

1 Answers1

0

You can try to make changes in your hosts file and force DNS resolution (old DNS to new ip, I'm using 192.168.0.2 as example)

192.168.0.2 old.dns.entry

This is not the best solution but works in some environments.

fab23
  • 59
  • 8
  • Yikes, no, don't do this. Never make your hosts file lie about DNS entries on the live internet, you absolutely will regret it. – Andy Ross Dec 17 '12 at 05:46
  • 1
    I bet with You about activate.adobe.com ping results on your friends laptops. Let me know how many people returns the right ip address which is not 127.0.0.1 :) – fab23 Dec 17 '12 at 08:46
  • 1
    @fab23 I see what you did there... – Raja Anbazhagan Nov 21 '16 at 09:00