TLDR: If X exists as a remote branch, then git checkout X
should create a local branch of it. In my case, for a single branch, it does not.
The remote repository has a master,
release,
and some other branches (say refactor-update
)
I do:
git clone WHATEVER/repo.git
git checkout release
But I do not get the normal branch switch message, nor is a local branch tracking origin/release
created (per the man
page for git checkout
). I am still on master.
Note that if I do git checkout refactor-update
everything works as expected.
This is reproducible on other computers (though the same platform and likely the same version of git). I have (out of desperation, not because I thought it would work), removed the release
branch and replaced it with a backup and master
respectively with no change in behaviour (git push origin :release && git push origin master:release
)
I am stuck for what might be causing the problem. My suspicion is that git checkout
doesn't seem to recognize the word release
for some reason, which would make it much like executing just git checkout
. To try and follow up on this, in another repo I created a release branch to see if it was a reserved word or something, but it is definitely just in this repository. There doesn't seem to be anything out of the ordinary in .git/config
.
Git version: 1.8