关于Git的错误

写完代码以后,不能继续提交,错误显示是这样的。

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

大致意思是,有个其他进程在操作这个仓库,所以无法继续提交。

只需要删除index.lock文件即可。

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

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,523评论 25 708
  • 垃圾收集策略 自动垃圾收集机制原理 执行环境会负责代码执行过程中使用的内存。比如var a = 1,会在栈上占有内...
    林立镇阅读 120评论 0 0