gitを使っていて、git addやgit pushなどのコマンドを実行したとき、以下のような'.git/index.lock': File exists.エラーが出るときがあります。
$ git add *
fatal: Unable to create '/home/xxx/.git/index.lock': File exists.
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
index.lockファイルは、同じgitリポジトリに対して同時に複数の操作を行わないよう、排他制御を行うためのロックファイルです。
対処方法
他のウィンドウやcronのバッチなどで、gitコマンドを実行している場合は、終了するまで待ちます。
以前にgitコマンドを実行していて強制終了させたなど、心当たりがある場合は、下記のように手動で.git/index.lockファイルを削除すれば大丈夫です
rm /home/xxx/.git/index.lock
こちらもおススメ