1

About the question: Why does git status show branch is up-to-date when changes exist upstream?

I realize that "git status" can not know the real remote latest version until "fetch".

But SourceTree sometimes know it, and show a number upon the "Pull" button.

How can it do that? By use "fetch"?

By the way, SourceTree use "fetch", why can it "sometimes" show the latest version?

Ry-
  • 218,210
  • 55
  • 464
  • 476
chen lan
  • 13
  • 3
  • `git ls-remote` tells what the refs are like in the remote repository without having to fetch them first. – ElpieKay Mar 05 '18 at 07:49

1 Answers1

1

Source tree has a setting to run a fetch command in the background every X minutes. That's how it'll know if there are upstream changes without requiring you to explicitly hit the fetch button:

enter image description here

Philip Pittle
  • 11,821
  • 8
  • 59
  • 123