8

I see this for egit's Push to Upstream:

demo

It says "Push current branch."

When I use it, all branches get pushed instead of only the current one. Is there a way to configure it to push only the current branch?

Dylan Wheeler
  • 6,928
  • 14
  • 56
  • 80
levant pied
  • 3,886
  • 5
  • 37
  • 56

1 Answers1

3

Check your git configuration for the push policy:

git config push.default

(same as "Eclipse > Window > Preferences > Team > Git > Configuration")

It should be "simple" to be sure to only push the current branch (to an upstream branch of the same name)

On Egit, check Team -> Remote -> Configure Push to Upstream
Pushing a single branch wasn't supported in 2011, because of an old JGit bug.
The table "How compatible is EGit with Git?" does not mention push.default. Here is the current implementation of

I usually prefer to use pushing the current branch option explicitly (instead of push to upstream)

push

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks @VonC - tried adding push.default=simple, but it did not help. I also prefer using Push Branch 'master'..., but when I by mistake use Push to Upstream, all my local branches get pushed, which I then need to go and clean up one by one. – levant pied Oct 03 '16 at 14:41
  • @levantpied OK: what version of Eclipse and EGit are you using? Would the issue persists with an Eclipse Neon 4.6 and the very latest EGit 4.5.0.201609210915-r? – VonC Oct 03 '16 at 15:43
  • Thanks @VonC - using Mars.2 4.5.2. Just tried Neon 4.6.1 and Egit 4.5.0. Unfortunately it works the same. Actually, it works worse, now it doesn't even pop up the dialog saying that it pushed those branches, does it silently... – levant pied Oct 03 '16 at 17:05
  • For the silent behavior, it looks it's this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=498176. I understand why the change, but the end result of silently not telling the user what happened is problematic at best. – levant pied Oct 03 '16 at 17:47