I forked a project a few weeks ago. The main repository is on a private server.
$ # on gitserver.com
$ git clone --bare main.com:myproject
Now I’ve added the upstream repo and fetched new data.
$ # on desktop.com
$ git clone gitserver.com:myproject
$ git remote add upstream main.com:myproject
$ git fetch upstream
When I try to push the upstream branches to my own remote repo, I get an error for branches that exist on upstream but not in origin.
$ 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 '...'
How can I create this remote branch on origin and push to it?
Try:
if that doesn’t work, try: