First check the source of your repository.
git remote -v
Rename the current source to ensure that there will be no conflict.
git remote rename originname ancient-origin
Define the new repository source.
git remote add origin repository_address
Check if the changes occurred as requested.
git remote -v
To avoid the accumulation of sources, remove the old source.
git remote rm ancient-origin
Again, check that the changes have occurred as requested.
git remote -v
Top comments (1)
you can use
git remote set-url origin repository_address
to change the origin quickly.