George Edwards
George Edwards

Reputation: 9229

Git not displaying branches other than master

I have just cloned a repository which worked and all the files I am expecting to see from my master branch are there. However, the repository also has another branch, experiment. When I run git branch, it is not displayed, even after I run git fetch --all. In my repo in the cloud (Visual Studio Team Services, was Visual Studio Online) I can see it, just not locally. What do I need to do to check this branch out?

Upvotes: 1

Views: 371

Answers (1)

Thomas Stets
Thomas Stets

Reputation: 3043

git branch only shows your local branches. Use git branch -a to show all branches. Your missing branch should be displayed then.

Use git checkout experimentto create a local from the remote branch and check it out. After that a simple git branchshould also show a local branch experiment

Upvotes: 3

Related Questions