Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse egit: How to make remote branch local

In JIRA, we now have the ability to "create branch" for each issue. This is lovely, but these branches are only created remotely. If the developer then switches to this remote branch, he is oddly unable to push anything to it. This seems to be due to the fact that the branch is not imported into the "local" git repo.

Is there some way to do this?

Note that none of this poses any issue when the branch is created from Eclipse.

No "push" option, for whatever reason:

enter image description here

git config:

[core]
    symlinks = false
    repositoryformatversion = 0
    filemode = false
    logallrefupdates = true
[remote "origin"]
    url = https://[username]@bitbucket.org/[project-name]/[project-name].git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

... followed by many other branches, none of which is the one I am trying to use.

Here is what the Branches view shows me in Photon when I attempt to check out a branch:

Note the absence of the ellipsis after the "Check Out" option

Note the absence of the ellipsis after the "Check Out" option, which means I don't get to choose to "checkout as local branch".

Installing Photon on Ubuntu, I do see the ellipsis, and everything works just fine as described. Not so much on Windows.

Of course, Eclipse on Linux has tons of other quirks and bugs, so I won't be using that much. I'm old enough to remember when people believed in funny abstract ideals like "platform independence". Sigh...

like image 203
Marc Avatar asked Sep 17 '25 16:09

Marc


1 Answers

make sure you have these settings checked in your configuration. Otherwise there will be no dialog asking what to do with your newly checked out branch: Settings for GIT-Checkout

like image 170
Pepe Avatar answered Sep 20 '25 21:09

Pepe