Instead of removing and adding the url I would suggest something like this
git remote set-url origin git://new.url.here
This will resolve your query.
Changes URLs for the remote will Set it's first URL for remote <name> that matches regex <oldurl> to <newurl>. If <oldurl> doesn’t match any URL, an error occurs and nothing is changed.
Reference: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem
For more information about the installation of git and common git commands please go through the following link: