Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stderr: 'fatal: Unable to create '.git/index.lock': File exists. #1010

Closed
oma0256 opened this issue May 6, 2020 · 1 comment
Closed

stderr: 'fatal: Unable to create '.git/index.lock': File exists. #1010

oma0256 opened this issue May 6, 2020 · 1 comment
Labels
Q&A

Comments

@oma0256
Copy link

@oma0256 oma0256 commented May 6, 2020

I have a git script that fetches a file from a remote repository. Everything was working fine but then all of a sudden I'm running into this error below. Is their a way I can solve this using GitPython, any help will be much appreciated thanks.

GitCommandError
'git checkout origin/<branch_name> <filename>' returned exit code 128.
stderr: 'fatal: Unable to create '.git/index.lock': File exists.

if no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue.
@Byron Byron added the Q&A label May 7, 2020
@Byron
Copy link
Member

@Byron Byron commented May 7, 2020

It looks like the error is related to the git command-line tool, which might indeed have crashed, leaving a lock file preventing further access. This can possibly happen if the script is interrupted with Ctrl+C.

As there is nothing unusual about this happening, nor is there an indication that this is a bug in GitPython, I am closing this issue.
Please feel free to comment in the closed issue with follow-up questions or other comments that might make a bug reproducible.

@Byron Byron closed this May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.