I see this for egit's Push to Upstream:
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?
No, git push only pushes commits from current local branch to remote branch that you specified in command.
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.
Push to Upstream.. pushes your branch as you would expect for a remote-tracking branch. Push... opens a dialog and lets you specify which refspecs you should push up, including tags, special cases like HEAD:refs/heads/master, etc.
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
+refs/heads/*:refs/remotes/origin/*
, that owuld explain why it pushes all the branches.I usually prefer to use pushing the current branch option explicitly (instead of push to upstream)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With