My coworker pushed out a branch called xianx/update2023
, and I made a local branch to try and track it. However, I keep getting this error when I try to set the upstream of my branch to theirs.
D:\src\Demo\Models>git branch -u origin/xianx/update2023
error: the requested upstream branch 'origin/xianx/update2023' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
I checked to make sure that the remote branch does indeed exist.
D:\src\Demo\Models>git ls-remote origin
b6b5157e605f0c20f373f9a6c484b94c2553d7e4 refs/heads/xianx/update2023
But git fetch
just returns an empty newline and does not resolve the problem.
D:\src\Demo\Models>git fetch
I tried the solution here to use git fetch upstream, but it's not working either.
D:\src\Demo\Models>git fetch upstream master:master
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
D:\src\Demo\Models>git fetch upstream
fatal: 'upstream' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.