Git commit fails with SourceTree : error: unable to create temporary sha1 filename .git/objects/d8: File exists

Trying to commit to a Git repo with Sourcetree fails as follows:

git -c core.quotepath=false commit -q -m "Notes fri" -a
error: unable to create temporary sha1 filename .git/objects/d8: File exists

error: Error building trees
Completed with errors, see above

It is possible to commit without problems with command line Git.

With some googling I found the following commands to try but they didn't help:

git fsck
git prune
git repack
git fsck

I also tried the following, no help either

git gc

1 answer

Unfortunately this nabble discussion shows that 'Error building trees' doesn't necessarily mean anything within the context of the problem. It seems "error: unable to create temporary sha1 filename" and "error: Error building trees" don't go hand in hand. There's various discussions of this problem on StackOverflow so it's worth checking out this link.

With that link in mind it's worth checking out the permissions and chown the entire directory recursively, only if you get a permission denied error after trying repack or gc. Generally though, it seems more of a permissions problem due to multiple users committing to the same repository.

If the former doesn't work then it'd be worth knowing more about your setup, i.e. do multiple users have access to this repository?

Hi, thanks for answer. Repack/gc/other don't give me errors and recursive chown didn't cause any problems.

My setup is that I am only user of a remote repo at a network share.

I'll probably go with doing a clean clone of the repo when I got a proper time.

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
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,929 views 1 5
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