How do sourcetree know there are changes on origin?

How do sourcetree know there are changes on origin and display the number of new commit in the toolbar Pull button

 

 

2 answers

1 accepted

SourceTree can be (and is by default) configured to issue a "git fetch" command every few minutes.

In the options dialog, see "Check default remotes for updates every __ minutes".

 

By polling the connected server .... I'm not quite sure if the numbers can be determined if you use another hosting service as Bitbucket Server (as I don't use any other)

i'm interested in the git command it uses

I haven't any great expertise here, but If I look at the "atlassian-bitbucket-access.log" log file (within BITBUCKET_HOME), I see the following:

172.16.0.120 | http | i@13J5DP6x17x2603224x0 | - | 2016-03-04 00:17:44,994 
| "GET /scm/myProj/configdata.git/info/refs HTTP/1.1"
| "" "git/1.9.5.msysgit.0" | - | - | - | - | - | - |

This seems to be used to get the state of the remote repository (see: https://git-scm.com/book/be/v2/Git-Internals-Transfer-Protocols - info/refs)

Comparing this data with your local repository, SourceTree might determine the asked information.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

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

434 views 0 1
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