Comment 1 for bug 701696

Revision history for this message
Anders Kaseorg (andersk) wrote :

Indeed. Ordinarily you can explicitly disambiguate (see the first few paragraphs of ‘git help cli’): you can specify the branch with ‘git checkout ambiguous --’ or the directory with ‘git checkout -- ambiguous’. However, that doesn’t work when initially setting up a tracking branch:

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/what
$ git ls-files
what/file
$ git checkout what
$ git branch
* master
$ git checkout what --
fatal: invalid reference: what
$ git rm -r what
rm 'what/file'
$ git checkout what
D what/file
Branch what set up to track remote branch what from origin.
Switched to a new branch 'what'

Can you point out this problem to the upstream Git mailing list (<email address hidden>)?