It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to setup default push branch?

I have two remote brance, everytime I wanna push, I need to switch another branch in the push window. Can I set a remote branch as default?

2 answers

Right-click your local branch in the sidebar on the left, then select Track Remote Branch, and then the remote branch you want it to track. That will then be the default when you push next time.

I did as what you said, the default pull branch changed, but default push branch didn't change.

In that case you probably need to change your settings in Tools > Options > Git, the 'Push branches' option should be set to 'upstream'.

I did what you said, the result is the same as before.

Hmm, that's a bug. 'Upstream' should pre-select that branch, I re-produced it here and will fix.

Was this ever fixed? I think I'm experiencing the same issue.

I'm still experiencing this issue as well...

I just needed to allow SourceTree permission to change my GIT configuration (global tab) and the problem goes away

I'm still seeing this issue. It has been over two years, when can we expect a fix?

Yes this is still an issue. In the right-click menu for the branch, the correct tracked remote is shown. If you click this menu item, the correct remote is pre-selected in the push branches dialogue. However, if you use the keyboard shortcut for push (command-shift-P in my case) when it opens the push branches dialogue, it pre-selects 'origin' even though the only branch ticked is one branch set to track a different remote. It feels like if you could skip the push dialogue (which I'd like to do as it's pointless anyway), it would work. Or if there was a keyboard shorcut for that right-click menu, it would also work as you could just hit enter to OK the push branches dialogue.

Deleted user Mar 15, 2017

Thank you, "Tools > Options > Git, the 'Push branches' option should be set to 'upstream'" helped me!

This bug still exists in Sourcetree 2.1, but you can work around it by renaming your preferred push branch to "origin", and then secret sourcetree magic will allow that branch to be the default push branch.

This bug still exists in 2020 version 3.2.1 (Mac), along with many other Sourcetree bugs. Sourcetree feels like abandonware.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,955 views 0 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you