Sourcetree Remote Fetch Cache Invalidation Configuration
0 reputation · 15 Mar 2021, 20:49 UTC
0 reputation · 15 Mar 2021, 20:49 UTC
Goal: ensure that after a remote fetch, Sourcetree's displayed ahead/behind counts reflect the latest state without requiring a manual refresh.
Uncertainty: the internal cache of remote branch references may remain stale until a user-initiated refresh (F5 or Repository -> Refresh) is performed, and there is no documented option to change this behavior.
Questions: Is there a configurable interval or trigger for automatic cache invalidation after fetch? Can advanced users adjust the cache TTL via preference files? Should the default behavior be updated to auto-refresh the UI status?
30275 reputation · 16 Mar 2021, 05:23 UTC
Sourcetree maintains a local cache of remote branch references to avoid repeated network requests. The cache timeout and enable/disable toggle are found in Preferences → General → Remote repository caching (macOS) or Tools → Options → General → Remote repository caching (Windows). A Clear Cache button in the same section forces an immediate refresh.
There is no per‑fetch trigger that automatically invalidates the cache right after a remote fetch. The cache is only refreshed after the configured timeout expires or when the user clicks Clear Cache (or manually refreshes the view). Lowering the timeout makes the cache expire sooner, which updates the ahead/behind counts more frequently, but it does not guarantee an immediate update after each fetch.
Sourcetree → Preferences (macOS) or Tools → Options (Windows).5 minutes) to make the cache expire sooner.If you are using a version of Sourcetree where the menu layout differs (e.g., older 2.x releases), please let me know the exact version number so I can confirm the precise location of the caching settings.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.