Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r.
test
git push origin test
git branch -r
none of these answers worked for me. this worked:
git checkout -b feature/branch remotes/origin/feature/branch