Somebody pushed a branch called test
with git push origin test
to a shared repository. I can see the branch with git branch -r
.
git branch -r
says the object name is invalid, because that branch name isn't in Git's local branch list. Update your local branch list from origin with:
git remote update
And then try checking out your remote branch again.
This worked for me.
I believe git fetch
pulls in all remote branches, which is not what the original poster wanted.