Change remote git repository

Asked

Viewed 14,615 times

6

I am using an online tool to make version control of my repository git, would like to change the remote to use another reference.

How to change the remote repository (origin) git?

3 answers

7


There are some different answers to this question, but the one that best suited the situation was the following:

git remote rm origin
git remote add origin novo_repositório_a_ser_apontado.git

Source: Stack Overflow (English)

3

You can remove

git remote remove origin

add a new one with the new address

git remote add origin git://suaUrl

Change the remote directory

git remote set-url origin git://suaUrl

Or you can rename it the current one and add a new one.

git remote rename origin old-origin

git remote add origin novaurl

0

Or you can even create two repositories on your machine connected to two different remote repositories.

In any folder you create your new repository and the second one already exists and the origin that is placed can be chosen another word if it is to help identify.

In my case I have two repository one with origin and the other with gringa.

Ai when committing remember to be by the terminal in the right repository folder.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.