I've found an interesting scenario. This question is related to this one.
I have git (version 1.8.3.1) and I created a branch locally, then I pushed it to my remote repository. I checked (git branch -a
) that it exists on the remote repository.
Now, I have the repository setup on another machine. When I run the following commands (using the version 1.8.3.1):
git fetch
git checkout <my branch>
I checkout to my branch correctly.
However, I also have the git version git version 2.6.3. And when I run the above commands, I get the error:
error: pathspec '<branch name>' did not match any file(s) known to git.
I'd expect this error in case of an older git version (see the linked question), but why does it fail for the version 2.6.3?
If I checkout to my branch using the older version of git, I can also checkout it using the git version 2.6.3.
Does it mean that git developers decided to remove this nice functionality introduced in v1.7.0-rc0 and I have to run git checkout -b <branch> --track <remote>/<branch>
or am I making a mistake somewhere?