git status 128: index file open failed. Permission denied

Why am I having this problem?

I cloned a repository from BitBucket, did my changes and now when I try to commit I get this error. I am on a Windows 7 machine, I am the admin and I have full control on the files I am trying to commit.

Any suggestion?

1 answer

1 accepted

I've seen this problem intermittently (but rarely) and it's down to another Windows process locking files when it shouldn't. Windows isn't great at releasing file locks sometimes, and especially things that hook into Explorer can hold file locks well beyond their time (I sometimes can't save files from a text editor because TortoiseGit has locked a file).

If this doesn't go away on its own, I would use Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) to track down what's locking the file. You can search for file handles in Process Explorer using Ctrl-F and then either close or manually kill the process that is locking the file.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

570 views 1 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