更改 Git 远程 URL

检查现有遥控器

git remote -v 
# origin https://github.com/username/repo.git (fetch)
# origin https://github.com/usernam/repo.git (push)

更改存储库 URL

git remote set-url origin https://github.com/username/repo2.git
# Change the 'origin' remote's URL

验证新的远程 URL

git remote -v
# origin  https://github.com/username/repo2.git (fetch)
# origin  https://github.com/username/repo2.git (push)