maybe this has already been reported, but I didn't find it in the mail archive.

If I understand correctly, after I clone a repo, I should be able to
switch to branch foo just by running

git checkout foo

This doesn't seem to work if a folder called "foo" exists in the root
of the repo.

I got the same behavior with git on a Mac and git on Linux.

Steps to reproduce:

git clone https://github.com/dbpedia/extraction-framework.git
cd extraction-framework/

First the happy path - there is a remote branch "live-dev", but no
folder "extraction-framework/live-dev":

git checkout live-dev


Branch live-dev set up to track remote branch live-dev from origin.
Switched to a new branch 'live-dev'

Fine! Now the unhappy path - there is a branch "wiktionary", but also
a folder "extraction-framework/wiktionary":

git checkout wiktionary

Nothing - no response, no changes to working tree. .git/index seems to
be modified though.

Slightly different - cd to some folder, try checkout again:

cd mappings
git checkout wiktionary


error: pathspec 'wiktionary' did not match any file(s) known to git.

My workaround is that when I switch to a branch for the first time, I
have to call

git checkout -t -b wiktionary --track origin/wiktionary


Branch wiktionary set up to track remote branch wiktionary from origin.
Switched to a new branch 'wiktionary'

Looks good. After that, I can switch back and forth between branches
just by git checkout wiktionary / git checkout master.

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to