1

I'm very new to git. After complete osx reinstall I've noticed that I can't switch to other branches I've created before… There is only master:

$ cd /usr/local
$ git branch -a
  * master
  remotes/origin/master

On github I see all my 4 brunches… I want to recover them…

Could anyone explain me how can make available my other branches?

Drew
  • 594
  • 10
  • 25
  • 1
    What does `git branch -a` print? – Oleg Gopkolov Sep 16 '15 at 19:23
  • Thanx for reply. Updated the post – Drew Sep 16 '15 at 19:34
  • 2
    Just checkout the branches again. `git fetch` then `git checkout branch_name` – BrokenBinary Sep 16 '15 at 19:37
  • see this http://stackoverflow.com/questions/4743795/mysterious-vanishing-branches-in-git – Oleg Gopkolov Sep 16 '15 at 19:47
  • this didn't help because `git reflog` returns only this: `e3c2fee HEAD@{11}: pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master: Fast-forward 220d300 HEAD@{12}: pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master: Fast-forward 144e870 HEAD@{13}: pull --ff --no-rebase --quiet origin refs/heads/master:refs/remotes/origin/master: Fast-forward 02e5c4a HEAD@{14}: reset: moving to origin/master` – Drew Sep 16 '15 at 22:36

2 Answers2

0

Found an answer myself:

$ git fetch origin

# check all(remote branches):
$ git branch -v -a

#check out the branch(get local working copy):
$ git checkout -b test origin/test
Drew
  • 594
  • 10
  • 25
-2

if you are new to Github , i'd strongly suggest you to use github Desktop application to avoid complexities.You can easily manage your branches here. Command-line is always there to backup you up when you get used to the environment,concepts and stuff.

https://desktop.github.com

Adeel Ahmad
  • 990
  • 8
  • 22