1

I created an empty repo and initialized a Virtualenv for Python development. After installing the required packages and coming out of the Virtual env by deactivating, I am not able to add/commit to 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.

Steps Tried so far:

  • Removed index.lock file using the command rm -f .git/index.lock
  • Created .gitignore file in the home directory and added .env to it
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
Danis Fermi
  • 590
  • 1
  • 6
  • 17
  • 1
    You're running out of memory (including automatically allocated virtual memory on the disk), which is difficult but not impossible on MacOS. See https://discussions.apple.com/thread/6887841?start=0&tstart=0 – torek Apr 09 '17 at 16:49

2 Answers2

0

I had the same problem. It keeps trying to add the ".Python@ -> ..." link. If you add ./.Python to your .gitignore, everything works fine. If you clone the repo elsewhere you can add the .Python@ link to the new location of the python installation.

Alex Mac
  • 2,970
  • 1
  • 22
  • 39
aaron
  • 1
0

I found the answer in a comment here:

Error Killed: 9 after command "git add ."

"I found the solution! I have add venv dir (my virtualenv) into .gitignore then add and commit all others files."

I added the virtualenv directory the .gitignore file, then deleted the .git/index.lock file. Then I was allowed to use git add .

moth
  • 226
  • 2
  • 9
  • That just lets you re-run the command and "try again" - its not the underlying cause of the Killed: 9 – Stephen Jul 13 '18 at 17:39