background
Today I want to upstream a remote release branch “origin/release/20.Q2.0”, but when I do the operation of git branch --set-upstream-to=origin/release/20.Q2.0, there occurs the problem Git : fatal: Ambiguous object name: 'origin/release/20.Q2.0. Also the git checkout -b localpath remotepath does not work.
fix way
Adding refs/remotes/origin instead of simply origin/ worked, just like:
git branch --set-upstream-to=refs/remotes/origin/release/20.Q2.0
reference
https://stackoverflow.com/questions/3782893/git-fatal-ambiguous-object-name-origin-release-2-6