首页 > 解决方案 > 'Killed: 9' 使用 git add *

问题描述

使用时出现错误

git add *

这只是说

Killed: 9

如果我再次输入 git add * 我得到

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

如果我删除 .git/index.lock 并再次输入 git add * ,我会再次遇到被杀死的错误。

我检查了stackoverflow上的其他答案,比如

git add 命令失败并继续运行

但我不使用任何虚拟环境。

标签: gitgithub

解决方案


就我而言(将 Cocoapods 依赖项文件夹添加到可能相当大的 git 中),问题是 Apple 在 macOS Catalina 中的 git。更新brew install git解决了它。

必须启动新的终端会话才能使新版本可用。


推荐阅读