Git: fatal: Unable to create 'xxx/.git/index.lock': File exists.

"D:\Program Files\Git\bin\git.exe" checkout -b "gyn_xxx" "34e90a68"
fatal: Unable to create 'D:/xxx/xxx/.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.
Done

Press Enter or Esc to close console...

从仓库里clone了一个老的项目下来,新建分支和checkout都报这个错,
百度,google了发现都是叫删除 index.lock文件的和重启电脑,试了下还是不行,

最终在http://stackoverflow.com/questions/7860751/git-fatal-unable-to-create-path-my-project-git-index-lock-file-exists
这里找到了一种可行的方式:

就是设置文件的权限

Paste_Image.png

将项目的权限设为everyone可以全部操作,重新checkout后可行了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容