EXCEPTION:FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS

时间:2023-03-10 04:20:13
EXCEPTION:FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS

FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS

Hi, Today I will share you my other experience using git control system, it happened to me after I’ve created a branch, when adding my changes to remote or even committed my file I’ve started to see this fatal error, I can’t even push my final changes to remote repository.

Solutions:

This simply tells to remove index.lock file from the working tree and from the index.

1
rm -f ./.git/index.lock

If the above didn’t work try this one below.

1
rm .git/index.lock

That’s it that will do the trick EXCEPTION:FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS