Is it possible to modify the "push changes immediately" option?

The "Push changes immediately to" checkbox gives me the option to push my commit immediately, but it offers me the wrong remote.

Is it possible to configure this option to use a specific remote?

My current branch is origin/master, the option offers me the demo/master branch. (my repo have two remotes: demo and origin, both have master branch)

Thanks in advance!

3 answers

1 accepted

Hi Adam,

This will always work for your 'origin' remote. You could change your origin by going into your repository settings and changing the names of the remotes to switch to the remote you always want to push to. Generally this is the default because that's the remote you usually push to.

Cheers

If I change my origin remote's name to 'default', then I see the "push changes immediately" option as default/master but then immediately changes to demo/master

After several restarts now it's working with the name "default", thank you for the answer!

You can fix this issue by going to:

Preferences > Git > Set "Push branches" to "upstream"


I'm having the same issue. The remote branch that's shown here is stuck on the wrong remote branch "tony.t/master" when the branch is tracking "origin/master". I've tried set the branch to track different remote branches, and even deleted and recreated the branch but it stays stuck on "tony.t/master".

My `~/.gitconfig` has `push.default = matching`, which matches the setting in SourceTree prefs. I can confirm that running `git push` on the command line does push to the correct remote branch, as opposed to SourceTree, which doesn't.

Interestingly, the prefs dialog doesn't work for me. When I open it it can't be closed. Even after restarting and closing all the open windows. Maybe the prefs need to be cleared? I tried trashing `~/Library/Preferences/com.torusknot.SourceTreeNotMAS.plist` but didn't help.

Try modifying your git configuration file manually. If necessary, you can find it through the SourceTree options dialog.

push.default isn't really relevant. It effects which branches get pushed, not which remotes they get pushed to.

Check out this answer from stack overflow.

Yeah, thats not it (I do know how to use git). Heres the section fir that branch:
[branch "master"]
	remote = origin
	merge = refs/heads/master

Sounds like a SourceTree bug. I'd file a report at jira.atlassian.com. Post a link to the bug report here so others can vote it up.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

234 views 0 3
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot