Unable to commit due to .git/index.lock?

Hey guys, whenever I stage stuff, I keep receiving this error…

'Another git process seems to be running in this repository, e.g.
an editor opened by ‘git commit’. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue."

It also mentions something at the top about a index.lock file - I’ve looked online and it was recommended to delete the file, however I am unable to find the file in my .git directory when searching for it.

Eventually my changed files in Sourcetree are staged (not sure if this happens after a period of time, or because I try staging them a few times till it happens), and I am able to commit.

My gitignore contents:

"#Unreal Generated Files

*/Build
*/Binaries
*/DerivedDataCache
*/Intermediate
*/Saved
BuildingEscape/Content/StarterContent/Textures
BuildingEscape/Content/StarterContent/HDRI

#Visual Studio Generated Files
*.VC.db
*.VC.opendb
*.suo
"

I added in *.VC.opendb due to an error I received about it in a prior staging (it was also recommended online to add this into gitignore to fix that particular error).

Any advice would be appreciated!

Thanks

Hey!
I’m not 100% sure, but I think it happens when you press the Stage command twice.
By that I mean, sometimes with larger files it looks like nothing is happening, but it actually is a bit laggy to respond, so if you press Stage All again it gives that weird error. I’m not sure what the index.lock file is though.

Cheers,
Shad

Privacy & Terms