GIT: /.git/index.lock': File exists GIT: /.git/index.lock': File exists git git

GIT: /.git/index.lock': File exists


Sudo the command:

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

Both errors suggest index.lock is owned by another user. Run the rm as a superuser, then try your commands again. You might also consider setting core.sharedRepository to true if that is, in fact, the case with your repo:

core.sharedRepository

When group (or true), the repository is made shareable between several users in a group (making sure all the files and objects are group-writable).

When all (or world or everybody), the repository will be readable by all users, additionally to being group-shareable. When umask (or false), git will use permissions reported by umask(2). When 0xxx, where 0xxx is an octal number, files in the repository will have this mode value. 0xxx will override user's umask value (whereas the other options will only override requested parts of the user's umask value). Examples: 0660 will make the repo read/write-able for the owner and group, but inaccessible to others (equivalent to group unless umask is e.g. 0022). 0640 is a repository that is group-readable but not group-writable.

See git-init(1).

False by default.


The issue ended up being Aptana, everytime I ran this it would cause this error when I tried to commit in git.

I stopped using aptana studio and I don't have this issue anymore.


Do this:

rm index.lock

followed by

git reset