Rename Git remote to new Remote Repo URL

Git at the moment doesn’t provide rename for remote repository url. So first need to

$git remote rm origin
$git remote add origin <new url>

Then, after that need to reset the tracked branch.
For my case, I’m using ‘develop’ branch as default branch

$git config branch.develop.remote origin
$git config branch.develop.merge refs/heads/develop
Advertisements