- Copy url from the codecommit
- Delete remote url
git remote set-url --delete codecommit {old_URL}
you may get the following error but ignore it.
fatal: Will not delete all non-push URLs
- Add new remote url
git remote set-url --add codecommit {new_URL}
- Check the URL
git remote -v
- Repeat the setp 2
git remote set-url --delete codecommit {old_URL}