我正在尝试学习如何使用Git,并且已经创建了一个包含HTML、CSS和Javascript文件的小项目。我从基本上空的项目中创建了一个分支,然后对我的代码进行了一些更改。我尝试暂存更改,但收到以下错误消息:
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,因为我不知道如何摆脱我以某种方式获得的东西。
有没有办法解决这个问题,或者我应该启动一个新的存储库?
发布于 2016-06-24 09:05:37
尝试删除.git
目录中的index.lock
文件。
rm -f .git/index.lock
当您同时执行两个git
命令时,通常会出现这样的问题;一个可能是从命令提示符执行,另一个可能是从集成开发环境执行。
发布于 2016-12-19 17:37:25
在应用程序的根目录中使用以下命令。这将删除index.lock文件并释放活动锁。
rm .git/index.lock
发布于 2016-06-24 09:45:44
好的,我最终通过运行'$ git rm.git/index.lock‘让它正常工作……这很奇怪,因为我以前做过几次,但都没有用,但是,嘿,电脑,对吧?
https://stackoverflow.com/questions/38004148
复制相似问题