| 用途 | 修改 fetch/push 地址 |
|---|---|
| 场景 | 协议切换、域名迁移、镜像仓库 |
| 验证 | git ls-remote origin |
常用示例
常用示例
git remote set-url origin git@github.com:org/repo.git
git remote set-url --push origin git@example.com:mirror/repo.git
git remote -v
git ls-remote origin | head改完地址先用 git ls-remote 验证连通与权限,比直接 fetch 更快暴露问题。