Why does Source Tree Pull fetch twice?

Why does 'Pull' perform a 'git fetch' followed by a 'git pull', instead of a 'git fetch' followed by 'git merge/rebase', or just 'git pull' without a redundant first fetch (since 'git pull' is just a short cut for fetch+merge..)?

It seems that requiring two round trips to the server instead of just one would be worse for performance, so is there something additional that the initial 'git fetch' accomplishes?

1 answer

This widget could not be displayed.

I believe that if you hit "Pull", but there are new commits that your local repository isn't yet aware of, SourceTree uses the first fetch to notice this, then halt the operation. I assume it's an extra mistake-prevention feature beyond the default git behavior, so you don't end up merging/rebasing commits that you didn't know existed.

The second fetch is still pointless, so you might consider submitting a feature request at jira.atlassian.com to see if they would consider modifying the button to do a fetch and merge/rebase instead of fetch and pull.

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...

869 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