Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Answered by Byron
oma0256 asked this question in Q&A
Discussion options

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.
You must be logged in to vote

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.

Replies: 1 comment

Comment options

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.

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1010 on February 26, 2021 11:18.

AltStyle によって変換されたページ (->オリジナル) /