Help us understand the problem. What is going on with this article?

Gitでcommitとpull時にindex.lockのエラー

More than 5 years have passed since last update.

windows環境でcommitを行おうとした際に下記エラーでcommitやpullできないとの報告があり調査。

fatal: Unable to create 'C:/path/to/.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.

エラー主さんで、.git/index.lock のファイルが存在しているため削除をしたみたいだが、また index.lock が復活してしまうとのこと。

確かに、いろいろ調べてみると、 .git/index.lock の削除で対応できそうな感じだけど、うまくいかない。

どうやら、.git/.COMMIT_EDITMSG.swp の削除で解決した人がいるらしいが、エラー主さんに確認してもらったところ、ファイルがない。
.git/COMMIT_EDITMSGファイルが存在するので、それを削除してもらったら解決した。

結果、 .git/index.lock.git/COMMIT_EDITMSG のファイル削除で解消。


参考サイト
* 困った&困っていること
* git commit したときにfatal: could not open '.git/COMMIT_EDITMSG': Permission denied が出た場合

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした