Why does SourceTree connect to a remote repository when I commit locally?

When I do a local commit in git using SourceTree, I can see (from LittleSnitch) that SourceTree communicates with a remote repo. But why? I'm not asking to push while committing (and in any case this isn't even a tracked branch; I'm trying to work completely locally). This feels like a bug.

2 answers

1 accepted

Hi Matt,

I've created an issue for this on JIRA: https://jira.atlassian.com/browse/SRCTREE-1684. I'll be doing some more thorough checks on this one and fixing it upon findings.

Cheers

Thanks, Kieran! In the meantime I've used Steve's hint to turn off background remote checking for all my repositories individually.

It's actually not related to the commit, but the periodic remote refresh (Fetch in git, incoming/outgoing in hg) SourceTree uses to display up-to-date pending markers for push/pull. By default this runs every 10 minutes, it must just have kicked in at a similar time.

If you'd prefer it didn't do this, you can disable it per repository (Settings in the toolbar > Advanced > Refresh remote status in the background), or globally for all repositories (Tools > Options > Check default remotes for updates every X minutes)

That's assuming you don't have the 'Push immediately' option enabled in the commit dialog BTW, which would obviously communicate with the remote - but that's disabled by default).

Thanks, Steve! I couldn't find Tools > Options, but I can find Preferences > General, and "Check default remotes" is *unchecked*. I think I would intuitively expect that since this a global preference, individual repositories would just obey it.

The repository setting for (Toolbar) Settings > Advanced > "Refresh remote status in the background" is *checked*, but that checkbox also says "if enabled in global preferences", and it isn't. So again, this feels like a bug. I am not doing anything that should involve communication with the remote repo. I'll try unchecking it and see if that helps. Thx.

Sorry, I was talking about the Windows version - yes it's in Preferences on Mac. So yes if the global 'check default remotes' is unchecked it shouldn't be this.

Can you reproduce it whenever you commit? We definitely don't attempt to do anything with the remote when you commit unless you check the Push Immediately box, but maybe there's a refresh that's happening afterwards that is querying the remote by accident - I would have thought we would have noticed that before since remote checking always slows things down, so we try to avoid it at all costs, but if you observe it every time w can check a bit deeper.

I may be wrong about *when* SourceTree is connecting to the remote repo, but I am not wrong that it *is* doing so. It definitely is doing so. LittleSnitch tells me so. For example, I just launched SourceTree, and the bookmarks window opened - and SourceTree connected to the remote repos of both of them (one is at github, the other is held by O'Reilly), even though "Check remote defaults" is *unchecked* in the preferences.

Thus I suggest that there *is* a bug and that you *should* dig deeper. I will turn off "Refresh remote status in the background" on a repo-by-repo basis and see if it makes a difference, but the point of a global preference, if it is working like a global preference, is that I should not have to.

(You say, by the way, "we would have noticed that before since remote checking always slows things down, so we try to avoid it at all costs". I would answer, yes, indeed, it is the very fact that SourceTree does certain things so slowly, such as launching, opening a repo window, and committing, that got me thinking about this issue.)

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

651 views 0 4
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