git add . : Killed: 9

git add . : Killed: 9

Killed: 9

git add . Killed: 9
python unable to Add/Commit to git from Virtualenv
python environment directory can’t use git


python에서 독립된 환경을 유지하기 위해 Virtualenv을 많이 사용하곤한다.
하지만, 이러한 가상환경 디렉토리를 git에 add/commit하고자 할 때 Killed: 9 의 에러를 주면서 동작하지 않는 경우가 있다.

fatal: Unable to create 'your/venv.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.

다음과 같은 에러를 띄우면서 말이다.
이러한 경우 아무리 .git파일을 삭제하고 다시 git init을 해도 git add. 을 사용해 add할 경우 다시 Killed: 9 를 띄우며 죽는다.

원인은 가상환경의 크기가 너무 크기때문! Killed: 9는파일의 크기가 너무 클 경우 나타나는 에러 메세지이다.

따라서 이 경우에는 가상환경 디렉토리를 gitignore해주면 된다.

그 방법은

우선 .gitignore 파일을 만든다.

vi .gitignore

그리고 가상환경 디렉토리를 추가해주면 된다. 보통 가상환경을 activated 해주는 파일이 담겨있는

bin/ 폴더를 추가해주면 된다.

gitignore

댓글

이 블로그의 인기 게시물

CGV 상영시간표 알리

[Swift Error] Outlets cannot be connected to repeating content.

tensorflow softmax_cross_entropy_with_logits