Why are all local branches pushed by default? [message #716471] |
Wed, 17 August 2011 14:04 |
Dominik Schadow Messages: 15 Registered: July 2009 |
Junior Member |
|
|
When I e.g. clone a Git repository from GitHub, create a local branch, do some work (add, commit, merge), do not delete the local branch, and push my changes, my formerly local branch is pushed to my GitHub repository. Sure, the Configure push dialog tells me, 'All branches will be pushed using Push Spec "refs/head/*:refs/heads/*"'. But why is this the default? With Git on the command line, a new local branch is not pushed by default; I'll have to do that explicitly.
With EGit, all branches of all developers pushing to this repository are shared, which isn't my intention. And the only solution I'm aware of is for every developer, to update his configuration to only push from local master to remote master. This configuration work seems unnecessary to me, since the Git workflow recommends creating a branch for all changes first, and only push from master. And not all local branches can/ should be deleted right away after merging the changes.
I'm using Eclipse 3.7 with EGit 1.0.
Thanks, Dominik
[Updated on: Wed, 17 August 2011 14:05] Report message to a moderator
|
|
|
|
Re: Why are all local branches pushed by default? [message #716515 is a reply to message #716493] |
Wed, 17 August 2011 15:28 |
Dominik Schadow Messages: 15 Registered: July 2009 |
Junior Member |
|
|
OK, thanks for your reply. I've compared the EGit behavior to msysGit today, not the original reference.
From a normal (hopefully ) developers' standpoint, an "only push master by default, everything else must be selected explicitly" behavior makes more sense to me. Since the normal Git workflow is to create a (short living local) branch for every change, publishing those branches by default is unnecessary. And why bother everybody with such configuration work?
Am I the first one bringing this up? Sure, you have followed the original implementation, but what's about the users out there? OK, such a poll might end up 50:50.
Regards, Dominik
|
|
|
|
|
Re: (no subject) [message #716920 is a reply to message #716785] |
Thu, 18 August 2011 19:20 |
Manuel Doninger Messages: 119 Registered: October 2010 |
Senior Member |
|
|
Which branch do you use as source, when creating a local branch? If you use a remote tracking branch (e.g. origin/master), then EGit pushes your local branch, because the branch is connected with an upstream branch, the remote tracking branch, from which you created the local branch. If you use a local branch as source (e.g. master), then EGit doesn't push your local created branch. So EGit doesn't push all branches, but all branches with an upstream branch (the upstream branch doesn't have necessarily the same name as the local branch)
[Updated on: Thu, 18 August 2011 19:24] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05225 seconds