Is SourceTree too aggressive in pushing branches?

We've recently switched everyone at our company over to using SourceTree and in general it seems like a vast improvement except that we think the push behavior might be too aggressive. This manifests itself in two ways

  1. When you click commit and then check the "Push commits immediately to ..." we expected it to be the equivalent of a commit and push only for the current branch. However, it seems to push ALL branches.
  2. When you click Push the drop down dialog has a list and new branches are automatically checked.

This has resulted in new branches being pushed to a shared hosted repository accidentally. Since git encourages small batches of work and frequent branching and merging it seems reasonable for people to have multiple streams of work in progress as they switch from task to task. Defaulting to include all branches is counter-intuitive and it would make more sense to only push the current branch instead.

Does this line of thought seem reasonable?



1 answer

1 accepted

0 votes
Accepted answer

Hi Chuck,

Fair point - it's been raised already that 'Push immediately..' in the commit dialog really should only push the current branch, and I intend to change that in future:

As for the main Push dialog, the auto-checking is done for branches that are tracked only. If new local branches are being automatically checked, it's because they are configured for tracking. You can check this by performing 'git remote show <remotename>'.

I just did a few tests here, and new branches created in SourceTree were not automatically checked in the push dialog, and 'git remote show' did not include them in the section "Local refs configured for 'git push'". The only case when SourceTree auto-checked them was if they appeared in that section. Maybe something in your workflow is causing them to be set up as tracked branches?

Indeed you are correct on the new branches not automatically being checked in the push dialog. I think it must be our workflow and we're looking to update it accordingly.

Thanks for the speedy response and we'll look forward to the update.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,111 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you