Sourcetree and Corrupted Loose Objects

Jack Cheung March 22, 2015

We started using Sourcetree on Mac for our Git repositories at work and ever since then I will frequently get a corrupt loose object (e.g. http://stackoverflow.com/questions/4254389/git-corrupt-loose-object). This has occurred 4-5 times in the last month.

I believe this problem occurs when you interrupt a git operation before it finishes. However, when I actively use Sourcetree, I never interrupt any of the operations and I always wait for everything to finish. Has anyone else ever experienced this issue? Is Sourcetree doing git operations in the background that I am accidentally interrupting? I do move around a lot and switch/lose internet a lot.

 

Also, I know how to fix the issue once it happens by re-cloning the repo. I don't need help with that. What I need is a solution to prevent it from occurring in the first place since it's very disruptive to our work.

1 answer

1 accepted

1 vote
Answer accepted
Jack Cheung April 28, 2015

I disabled the Sourcetree Preference to "Check default remotes for updates every X minutes" and this problem has never occurred after a month of constant development. This is enough to make me think my original hypothesis about interrupting sourcetree git commands in the background was correct.

The downside of this is that you will not automatically see updates to pull. I got into the habit of constantly pressing the hotkey for "Refresh Remote Status" every time I switch to Sourcetree and it gets the job done.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events