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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

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

649 views 0 4
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