简体   繁体   English

错误被杀:命令“git add”后9。

[英]Error Killed: 9 after command “git add .”

I have a problem when I do "git add ." 我做“git add”时遇到问题。 I received an error message "Killed: 9". 我收到错误消息“Killed:9”。 If I try again "git add ." 如果我再试一次“git add”。 I received an another error: 我收到了另一个错误:

fatal: Unable to create './crmeasy/.git/index.lock': File exists. 致命:无法创建'./crmeasy/.git/index.lock':文件存在。

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.

If I delete ./.git/index.lock file and try again I receive the same cycle of errors. 如果我删除./.git/index.lock文件并再试一次,我会收到相同的错误周期。 I try to commit new empty Django project virtualenv dir. 我尝试提交新的空Django项目virtualenv目录。 How could I solve the issue? 我怎么能解决这个问题?

This happens if you are adding your virtualenv to git. 如果你要将你的virtualenv添加到git,就会发生这种情况。

Solution: Add the path to your virtualenv in your .gitignore file. 解决方案:.gitignore文件中添加virtualenv的路径。 Now you can git add --all 现在你可以git add --all

Recommended further reading: 建议进一步阅读:

Is it bad to have my virtualenv directory inside my git repository? 将我的virtualenv目录放在我的git存储库中是不是很糟糕?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM