You may want to do this if the remote repository is migrated. The command for changing the remote url is:

git remote set-url

It takes 2 arguments: an existing remote name (origin, upstream) and the url.

Check your current remote url:

git remote -v
origin    <https://bitbucket.com/develop/myrepo.git> (fetch)
origin    <https://bitbucket.com/develop/myrepo.git> (push)

Change your remote url:

git remote set-url origin <https://localserver/develop/myrepo.git>

Check again your remote url:

git remote -v
origin    <https://localserver/develop/myrepo.git> (fetch)
origin    <https://localserver/develop/myrepo.git> (push)