When I try to create a new branch tracking a remote branch, I get this:
$ git branch -t test origin/foo
error: Not tracking: ambiguous information for ref refs/r
I got in a situation like this, but I do not know how. The listing from git branch -av
showed me only a single remote tracking branch for the branch I cared about (origin/dev
).
What I did to fix it was to use the hexadecimal commit hash instead of origin/dev
:
git checkout -b dev abc123
git push -u origin dev
When I did the push with -u
Git said Branch dev set up to track remote branch dev from origin.
Subsequent pulls and pushes worked as I expected.