Search code examples
eclipsegitegit

Git switch branch in Eclipse


I have two branches (develop / master)

enter image description here

I want to switch branch in Eclipse but Master does not appear to select

enter image description here

enter image description here


Solution

  • It could be because you don't have a local master. If it is scenario, these steps might help you.

    To fetch master, you simply need to:

    git fetch origin master
    

    This will fetch master for you. You can see the branches available for checkout with:

    git branch -v -a
    

    With the remote branches in hand, you now need to check out the branch you are interested in, giving you a local working copy:

    git checkout -b master origin/master