Take the 2-minute tour ×

There is a branch in github that I can access via Eclipse/eGit. A colleague then created a branch off of that existing branch, but that new branch is not visible to me in Eclipse or from the command line. What do I need to do to make that branch-off-of-a-branch visible to me?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Your colleague needs to push it to Github, then you need to do a fetch to get it from Github. Then, if you want to work on that same branch yourself, you need to create a local branch based on it, which, in recent Git versions, can be done simply via git checkout <simple branch name>.

Update: So when you have trouble fetching remote refs, you should check that your fetch refspec looks something like +refs/heads/*:refs/remotes/origin/*, or you won't see the whole picture.

share|improve this answer
It is in github. I can view it there via the web interface. –  Chris Gerken Mar 4 '13 at 17:39
That means it's pushed. You need to fetch from Github to see it locally. –  Ryan Stewart Mar 4 '13 at 17:40
But the fetch... dialog in Eclipse doesn't show that branch –  Chris Gerken Mar 4 '13 at 17:41
I don't know Eclipse, but you don't choose a branch when you fetch. You just fetch. At the command line, you'd use git fetch or git fetch <remote name> if Github isn't your origin. Fetching from a remote downloads the latest stuff from the remote, including any branches that exist there. –  Ryan Stewart Mar 4 '13 at 17:43
So I fetch and I'm told everything's up to date. –  Chris Gerken Mar 4 '13 at 17:45

Your Answer


