본문 바로가기
Computer Science/Git

Git Error - Another git process seems to be running in this repository

by happy coding! 2018. 4. 23.
반응형

[Git Error]  Another git process seems to be running in this repository




Git을 사용하던 중 콘솔 창에 아래와 같은 에러 메시지가 출력되면서 Commit이 제대로 이루어지지 않은 적이 있다. 

에러 메시지는 Another git process seems to be running in this repository, e.g.





에러 메시지를 해석하면 'lock 파일이 이미 존재해서 파일 생성을 할 수 없다. 다른 프로세스가 이미 작업 중인 것으로 보인다.'


개념상 알아두어야할 것은 git 이 작업을 하기 전 .lock 파일을 만들어서 동시 작업이 일어나지 않게 막아놓는다는 것이다. 


이 경우에는 먼저 다른 창에서 작업 중인지 확인해보고, 이전 작업하다가 비정상 종료가 발생해서 lock 파일이 안지워졌는지 확인해본다. 비정상 종료로 인해 상기 에러가 발생한 경우 .git directory에서 index.lock 파일을 지우면 된다. 





스택오버플로우에서는 상기 에러에 대해 다음과 같이 친절하게 답변하고 있다.


try deleting index.lock file in your .git directory.


Generally such problems occurs when you execute two git commands simultaneously maybe one from command prompt and one from IDE.

반응형

댓글