在一个存储库中时,您需要将更改推送到另一个存储库(git merge和git push.)中的分支。
我这样做
git remote add repo2 ssh://git@gitlab.name.com:22123/name-project/repo2.git
git fetch
git checkout -b branch2 repo2/branch2
结果:
fatal: 'repo2/branch2' is not a commit and a branch 'branch2' cannot be created from it
如何将更改添加到远程存储库中的分支?
默认情况下,该命令
fetch从当前分支引用的存储库中下载对象和引用。您需要从所有添加的商店中获取对象(和引用):
或仅来自明确指定的存储:
甚至只能通过显式指定存储中的显式指定引用访问的对象: