Why does Source Tree Pull fetch twice?

Carson Lee January 27, 2015

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

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 27, 2015

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
TAGS
AUG Leaders

Atlassian Community Events