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

1 vote
Accepted answer

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
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

845 views 3 2
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