Is there a way to set the default pull location (remote & branch)?

I pull from upstream and push to origin, but the default pull location is always origin and I need to remember to select upstream each time. Is there any way to change this in the config file or menu settings?

1 answer

This widget could not be displayed.

Hi Robert! To achieve that you'll need to add your preference to the repo's config file in SourceTree. To do so, open SourceTree, navigate to the repo and click Settings (cog icon on the top right corner) > Remotes > Edit Config File. Then, if you don't have it already, add a section for the branch you want to configure and add your remote there, it will look something like:

[branch "master"]
    remote = upstream
    merge = refs/heads/master

Hope this helps! Let us know if you have any other questions and we'll be glad to help :)

Cheers,

Ana

Does this change the default push settings to upstream?

If so, I've just exchanged one problem for another.

Hi Robert, I tested it and my push settings remained to origin. Is this not the case for you?

Nope. It didn't work for me. origin is still the default.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

871 views 2 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