Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why are all branches selected by default in SourceTree when pushing?

Jeremy Glazman July 5, 2012

When pushing changes to a branch of a git repository via SourceTree, by default all possible branches are selected:

Is this intentional? Shouldn't it just default to pushing the branch I currently have checked out?

There's a "Select All" button right there which is toggled off by default, so shouldn't the default selection NOT be to have everything selected? Clicking on "Select All" actually does nothing, because everything is already selected. This makes me think this behaviour is not intentional.

2 answers

1 accepted

19 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 7, 2012

Paul's right, it actually pre-selects based on the default behaviour of 'git push' without any parameters. This is based on the default behaviour of git, which is that the 'push.default' setting is 'matching' (branches called the same thing on local and remote).

However, in 1.5 I've added support for other values of 'push.default', and exposed these in the Git Preferences tab. So now you can opt for:

matching = push all branches which have same named counterparts on the remote
current = push the current branch only to a branch called the same thing on the remote
upstream = push the current branch to the branch it is tracking (if any) on the remote (may be a different name)
nothing = push nothing by default

When you alter this setting, the default checked boxes in the top-level Push dialog change to reflect this. You can get the beta for 1.5 now if you like: http://blog.sourcetreeapp.com/2012/07/06/sourcetree-1-5-beta-1/

Christopher Forbes December 23, 2014

The default setting in SourceTree should be current or upstream. I'm using a GUI for git for a reason; so things are easier and so you help me mess things up less. Just screwed over another branch because the branch was checked by default. Just went and bought a copy of Tower this morning. Super disappointed with dumb design decisions in SourceTree.

Russell Trafford February 22, 2016

Christopher, I disagree. Default setting should be what 'git push' does 'by default' without parameters and no gui.

Surely you can be 'super dissapointed' and move away from the product on just this one aspect, especially if it has been addressed and config options given to change it. I think there must be other things you are annoyed about with Sourcetree, cant just be that.

Anyway, I do however think that this feature needs to be labelled more clearly in the config. I looked on this exact page for this feature, and couldnt find it, I had to do a double take when I saw this post via google, and finally figured it out.

Sourcetree Devs: Please rename "Push Branches" to "Default Push Branch behaviour"
OR

"Branches to be pushed by default" 

and then an option for explanation of each, as they are not immediately clear.

But either way "Push Branches" is way too unclear.

Like Eric likes this
Christopher Forbes February 22, 2016

Thank you for the comments but I respectfully disagree. Please read in full The Power of Defaults

1 vote
Paul Curren
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 6, 2012

I saw this same question answered very recently but can't find the question. I'll have a go from what I remember.

Basically, push on the toolbar is equivalent to 'git push' with no further detail specified. Which is to say it will default to pushing every branch you are tracking.

If you only want to push a single branch you should right click on that branch itself and select to push.

Jeremy Glazman July 6, 2012

Yes, that appears to be it! Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events