2017-04-09 96 views
1

我创建了一个空回购并为Python开发初始化了一个Virtualenv。在安装所需的软件包并通过停用从Virtual env中出来后,我无法添加/提交给Git。无法从Virtualenv添加/提交git

[email protected]:~/Git/Sample-Repo$ git add * 
Killed: 9 
[email protected]:~/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. 

步骤到目前为止已经试过:使用创建的.gitignore文件中的主目录下的命令rm -f .git/index.lock

    • 删除index.lock文件,并添加.ENV它
  • +1

    你运行内存(包括磁盘上自动分配虚拟内存),这是困难的,但在MacOS并非不可能。请参阅https://discussions.apple.com/thread/6887841?start=0&tstart=0 – torek

    回答

    0

    我有同样的问题。它不断尝试添加"[email protected] -> ..."链接。如果您将./.Python添加到您的.gitignore,则一切正常。如果您在其他地方克隆回购,您可以将[email protected]链接添加到python安装的新位置。

    +0

    我这样做,并且目前仍然遇到Danis引用的错误。 – friendoflore

    0

    我发现在这里评论的答案:“我找到了解决办法我有加VENV目录(我的virtualenv)进入的.gitignore然后添加并提交所有其他文件。”

    Error Killed: 9 after command "git add ."

    我加入的virtualenv目录中的.gitignore文件,然后删除该文件.git/index.lock。然后我被允许使用git add .