Question

How do I get a new branch to show up in Eclipse Git Remote Tracking?

I have an existing Eclipse git project, with a master and development branch present in both local, and remote tracking. I have just added a new branch in my git repository, but I can't figure out how to get it to show up in Eclipse.

I have tried to read up on the subject, but it seems like it is just expected to automatically show up. I have found a lot of similar questions, but they all seem to deal with the issues of a completely empty remote tracking folder, instead of my problem of only a single new branch missing. I already have Master and Develop present.

Here is what does not work:

  • Clicking refresh in the Git repositories window.
  • Any kind of synchronize, pull or other update I can find

Here is what would work:

  • Right clicking the remote tracking folder, and selecting "Paste repository path or URI". If I do that, and select the exact same path as is already there, I can see my new branch. This action does require that I completely clone the whole repository to an empty folder again, and that can't be how this is intended to work.
  • I believe it might work to use some kind of command line tool, but I really want an Eclipse solution to this, as I feel sure it exists, and I am just missing something.
 46  89023  46
1 Jan 1970

Solution

 105

In the Git Repositories view:

  1. Right-click the repository and choose Fetch from Upstream
  2. If the new branch will not shown up below Branches/Remote Tracking, you have to configure fetch:
    1. Right-click the fetch node below Remotes/origin and choose Configure Fetch...
    2. In the Configure Fetch make sure there is only the single Ref mapping (assuming the remote is named origin) +refs/heads/*:refs/remotes/origin/*:
      Configure fetch
2017-11-20

Solution

 7

In case you do not see Fetch from Upstream after right-click the repository, you may look for Fetch from origin.

enter image description here

2020-12-18