I run command:
git add .
and get:
Killed: 9
It stops me running any git commands with a lock.
What is wrong with my git, I've tried rebooting, removing the directory and starting over with a new repo.
I was able to solve the same issue by adding things (that should not be in Git) to .gitignore
. In my specific case, there was a nested directory which had a Python virtualenv directory.
After adding venv/
to my .gitignore
and committing, I was finally able to commit the directory.
Same issue here, different solution (iOS project):
I did a pod update
in my project, but cancelled it with ctrl+c
. After that all my git commands were failing with
Killed: 9
I had to re launch my pod update
and let it finish, then delete the git lock with
rm .git/index.lock
If you have a git from Apple, maybe shifting to non-Apple version will work.
I got similar error like this:
$ git add demo
[1] 32003 killed git add demo
I checked my git version and found it came from Apple.
$ git --version
git version 2.20.1 (Apple Git-117)
$ which git
/usr/bin/git
after installing git from brew, it works.
$ /usr/local/bin/git add demo
$ /usr/local/bin/git --version
git version 2.26.2
But only this specify file (named 'demo') got git add
killed.
$ file demo
demo: Mach-O 64-bit executable x86_64
This file is about 22M, I tested a 30M zero file (generated by dd
) and a simple hello-world file generated by gcc
(file format Mach-O 64-bit executable x86_64), they all work.
Maybe shifting to official git will work. I have no idea why Apple-version git does not work.
I was able to fix this by triggering a re-install of the command line tools.
To do so, open a terminal and run xcode-select --install
. You'll get a prompt that will walk you through installing it.
Additionally, I saw that homebrew somehow hijacked my reversion of git.
You can determine that by running which git
. The result should be /usr/bin/git
. If it shows homebrew or brew anywhere in the path, you need to run brew uninstall git
. Open a new tab, and you should be good to go.
Killed: 9
suggests possibly your system is running out of memory. What OS are you using?