更换子模块地址
- 修改 .gitmodules
[submodule "libs/foo"] path = libs/foo url = https://github.com/old-org/foo.git改成:
[submodule "libs/foo"] path = libs/foo url = https://github.com/new-org/foo.git - 同步配置
git submodule sync - 更新子模块
git submodule update --init --recursive - 更新仓库
git add .gitmodules git commit -m "chore: update submodule foo url" git push
更换主仓库地址
- 查看当前远端
git remote -v你会看到类似:
origin https://github.com/old-org/project.git (fetch) origin https://github.com/old-org/project.git (push) - 修改 origin 地址
git remote set-url origin https://github.com/new-org/project.git验证
git remote -v - 推送到新组织(第一次建议加 -u)
git push -u origin main # 或 git push -u origin master
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://www.bcskill.com/index.php/archives/2456.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!