git add . 的时候报错fatal: Unable to create : …File exists.

报错内容: 

  $ git add .
  fatal: Unable to create 'E:/project/qbm_cs/.git/index.lock': File exists.

  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.

解决方法:

  git bash 输入如下命令:(注意中间有空格)

    rm -f ./.git/index.lock

  git add 报错 file exists

posted @ 2017-10-10 16:02  柠夏  阅读(3000)  评论(1编辑  收藏  举报