转载:https://blog.csdn.net/googler_offer/article/details/89466173
1, 首先添加仓库分支
git remote add
git remote add origin_repo_b git@server_ip:/path/repo_b.git
(origin_repo_b:自己起的名字,只要不与现有的remote名重复即可)
(git@server_ip:/path/repo_b.git:repo_b的远程路径)
2, 将代码推送到repo_b.
git push origin_repo_b branch_a
origin_repo_b:远程 仓库repo_b的名字
branch_a: 仓库repo_a的branch_a分支
3,克隆仓库repo_b,检查是否push成功
git clone git@server_ip:/path/repo_b.git