几周前我分叉了一个项目。主存储库位于私有服务器上。
$ # 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 '...'
如何在 origin 上创建这个远程分支并推送到它?