Git使用过程中遇到的问题以及一次提交多个文件

使用git时报错

Another git process semms 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 remove the file manually to continue…

在使用git commit命令的时候,由于忘记添加-m以及说明文字,系统进入了添加文字界面,但我又不知道如何退出来,于是直接把git Bash关掉,虽然关闭的时候它提示我可能出错,但我依旧淡定地关掉系统,在重新进入之后,再次使用commit命令,敲上注释,于是就报乐上面的错误

定睛一看,好像说的是有另外一个bash进程在运行,当时认为可能是进程没有完全关闭? 简单,百分之九十的报错都能用重启来解决,果断重启

再次打开软件,嘿嘿,一样的错误,于是只能百度,最后搜索到的结果是

Git在使用过程中遭遇了奔溃,部分被上锁资源没有被释放导致的

解决方法:

进入项目文件夹下的 .git文件中(显示隐藏文件夹或rm .git/index.lock)删除index.lock文件即可。

最终完美解决!

PS:

  • Git一次提交多个文件的命令如下
git add --all

猜你喜欢

转载自blog.csdn.net/weixin_45774350/article/details/114575571