15

I have a project in Gitlab that is available over HTTP/SSH:

[email protected]:MyGroup/MyProject.git

I want to change that using another IP, i.e.:

[email protected]:MyGroup/MyProject.git

Where or how can I change that?

1
  • 1
    Do you mean you've moved the repo to a new server (with new IP address) and want to know how to update clones to find it at this new location? Or do you mean you want to know what to do with the repo, so that this new URL would find it? Or something else? Commented Jun 6, 2017 at 14:14

3 Answers 3

21

You can use below command to set new URL for your repository.

git remote set-url origin git://[email protected]:MyGroup/MyProject.git
1
  • 1
    Should be the correct answer! ✅ Also to see that it took effect: git remote -v.
    – starikovs
    Commented Jan 2, 2019 at 11:26
4

You can find all repositories remotes inside the file .git/config. You can edit it by hand or use command git remote.

2

once You set url don't forget to check

git remote set-url origin git://[email protected]:MyGroup/MyProject.git

to check url properly set or not use below command

git remote show origin 

or

git config --get remote.origin.url

Not the answer you're looking for? Browse other questions tagged or ask your own question.