Change the repository source
Edson Junior de Andrade

Edson Junior de Andrade @edsonjuniornarvaes

About: Front-end developer, Web e Mobile

Location:
Umuarama-PR, Brasil
Joined:
Apr 26, 2021

Change the repository source

Publish Date: Sep 16 '22
0 1

First check the source of your repository.

git remote -v
Enter fullscreen mode Exit fullscreen mode

Rename the current source to ensure that there will be no conflict.

git remote rename originname ancient-origin
Enter fullscreen mode Exit fullscreen mode

Define the new repository source.

git remote add origin repository_address
Enter fullscreen mode Exit fullscreen mode

Check if the changes occurred as requested.

git remote -v
Enter fullscreen mode Exit fullscreen mode

To avoid the accumulation of sources, remove the old source.

git remote rm ancient-origin
Enter fullscreen mode Exit fullscreen mode

Again, check that the changes have occurred as requested.

git remote -v
Enter fullscreen mode Exit fullscreen mode

Comments 1 total

  • spO0q
    spO0qSep 16, 2022

    you can use git remote set-url origin repository_address to change the origin quickly.

Add comment