更改 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)