【发布时间】:2017-09-04 15:39:03
【问题描述】:
我创建了一个空的 repo 并初始化了一个用于 Python 开发的 Virtualenv。安装所需的软件包并通过停用从虚拟环境中出来后,我无法添加/提交到 Git。
danis@Daniss-MacBook-Pro:~/Git/Sample-Repo$ git add *
Killed: 9
danis@Daniss-MacBook-Pro:~/Git/Sample-Repo$ git add helloworld
fatal: Unable to create '/Users/danis/Git/Sample-Repo/.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.
到目前为止尝试的步骤:
- 使用命令
rm -f .git/index.lock删除了 index.lock 文件 - 在主目录中创建 .gitignore 文件并添加 .env 到其中
【问题讨论】:
-
您的内存不足(包括磁盘上自动分配的虚拟内存),这在 MacOS 上很困难但并非不可能。见discussions.apple.com/thread/6887841?start=0&tstart=0
标签: python git virtualenv