美文网首页
git报错Another git process seems t

git报错Another git process seems t

作者: 剑圣_盖小聂 | 来源:发表于2019-02-20 20:20 被阅读0次

    今天git切换分支时,遇到了这样的报错信息: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进程似乎正在这个存储库中运行,例如

    由“git commit”打开的编辑器。请确保所有流程

    终止,然后重试。如果它仍然失败,一个git进程

    可能已在此存储库中崩溃:

    手动删除文件以继续。

    通俗一点就是:当前已经有了一个编辑器打开了“git commit”指令,请关闭所有git相关的进程重试,否则,请手动删除那个文件。

    解决方法(从网上找来的):根据我们所了解到的,windows对于进程的同步互斥管理,是有资源上锁机制的。猜测这里肯定是有进程对某资源进行了加锁,但是由于进程突然崩溃,未来得及解锁,导致其他进程访问不了。

    这里根据vs2017的git管理工具的提示信息,打开文件夹选项,打开显示隐藏文件,进入工作区目录下的隐藏文件.git,其中的index.lock文件删除掉,然后重新打开git bash进程,问题解决。

    相关文章

      网友评论

          本文标题:git报错Another git process seems t

          本文链接:https://www.haomeiwen.com/subject/vbdkyqtx.html