DEV Community

Cover image for Change the repository source
Edson Junior de Andrade
Edson Junior de Andrade

Posted on • Edited on

Change the repository source

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

Top comments (1)

Collapse
 
spo0q profile image
spO0q

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay