git迁移代码到其他仓库的方法 个人记录
2026/6/22 2:55:26 网站建设 项目流程

克隆只包含指定分支的仓库

gitclone --single-branch --branch<branch-name><原仓库URL>

如:

gitclone --single-branch --branch develop-重构1128 http://xxxllm_platform/test.git
cd<repo-directory>

添加新的远程仓库

gitremoteaddnew-origin<新仓库URL>

eg:

gitremoteaddfrom-xxx-to-xxx https://xxx.test.git

推送分支到新仓库

git push new-origin <branch-name>

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询