1

I have a fork and i have used clone command to clone the repository in to my computer.Now it is showing me 1 branch but the fork is having 4 branches.

Series of steps i followed:

$ git branch
* master

HOME@H MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master)
$ git remote add upstream https://github.com/rahulkapoor90/VITacademics-Enhancement-Suite

HOME@H MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master)
$ git remote remove jwasham

HOME@H MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master)
$ git fetch upstream
From https://github.com/rahulkapoor90/VITacademics-Enhancement-Suite
 * [new branch]      Development -> upstream/Development
 * [new branch]      master      -> upstream/master
 * [new branch]      material-ui -> upstream/material-ui

Now i entered command git branch -a it showed in different colors.

$ git branch -a
* master
  remotes/origin/Development
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/material-ui
  remotes/upstream/Development
  remotes/upstream/master
  remotes/upstream/material-ui

But these branches are not showing in default branches when i enter git branch.But if i checkout any branch it is detaching from the HEAD.

How to fix this problem?Any solutions?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
SaiKiran
  • 6,244
  • 11
  • 43
  • 76
  • 2
    Possible duplicate of [How to clone all remote branches in Git?](http://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git) – IamK Dec 04 '16 at 21:38

1 Answers1

1

You've only one local branch called master. Other branches start with remotes/origin/* or remotes/upstream/* are remote.

If you want to create a local branch having changes/commits of a remote branch, then just checkout with branch-name. Or, create a new branch & pull the remote branch into your new-branch

  $ git checkout -b Development origin/Development

 Or,
  $ git checkout master          
  $ git checkout -b Development
  $ git pull origin Development         
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73