Sourcetree and Corrupted Loose Objects

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

0 votes
Accepted answer

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
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...

716 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