Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

eclipse

egit

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.
like image 516
jumps4fun Avatar asked Nov 20 '17 11:11

jumps4fun


People also ask

How do I pull a new branch in Eclipse?

To create a new branch in your repository, right click a shared project and navigate to Team => Switch to => New Branch… from the context menu. Select the branch you want to create a new branch from, hit New branch and enter a name for the new branch. The new branch should appear in the branch selection window.

How do I view a branch in Eclipse?

Right-click your project and select Team → Branch to create new branches or to switch between existing branches. You can also switch branches in the History view.


2 Answers

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
like image 101
howlger Avatar answered Sep 20 '22 15:09

howlger


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

like image 44
Lee Chee Kiam Avatar answered Sep 21 '22 15:09

Lee Chee Kiam