listing and switching /checkout to remote branch error

39 views Asked by At

git ls-remote origin lists all the remote with their commit IDs,

xxxx41   refs/heads/ABC
xxxx92   refs/heads/dummy_xyz
xxxx32   refs/heads/Feature/ABC
xxxx77   refs/heads/Feature/ABC-mgc

now when i checkout to any of the branch i get an error

error: pathspec "/Feature/ABC" or "/Feature/ABC-mgc" did not match any files known to git

i followed some questions on stack Remote branch not found

@schwern did wonderful explanation however i could not able to checkout.

1

There are 1 answers

1
Yedidya Rashi On

Try to fetch the branches first:

git fetch
git checkout {the branch that you want}