几周前,我fork了一个项目。主要的存储库在私人服务器上。
$ # on gitserver.com
$ git clone --bare main.com:myproject
现在我已经添加了上游仓库并获取了新的数据。
$ # on desktop.com
$ git clone gitserver.com:myproject
$ git remote add upstream main.com:myproject
$ git fetch upstream
当我尝试将上游分支推送到我的远程仓库时,对于存在于上游但不在原始仓库中的分支,我会收到一个错误提示。
$ git push origin refs/remotes/upstream/BRANCH_A:BRANCH_A
Everything up-to-date
$ git push origin refs/remotes/upstream/BRANCH_B:BRANCH_B
error: unable to push to unqualified destination: BRANCH_B
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to '...'
我该如何在远程仓库上创建这个分支并将其推送到其中?