question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A lock file already exists in the repository, which blocks this operation from completing.

See original GitHub issue

Description

Ive created a new repository with github desktop( i couldnt add local repository for some reason) in my small react app. When i want to commit i get the error message :A lock file already exists in the repository, which blocks this operation from completing.

Ive delete the package-lock.json file but it doesnt help. react build is not running. no idea what causes this. thanks for your help

Version

  • GitHub Desktop:1.3.4
  • Operating system: Windows 7Home Premium 64-Bit

Steps to Reproduce

  1. Add Local Repository. Choose Repository. Get redirected to create new repository.
  2. create new repository in project folder
  3. try to commit and get error message: A lock file already exists in the repository, which blocks this operation from completing.

Expected Behavior

Commit goes trough

Actual Behavior

Get Error Message : A lock file already exists in the repository, which blocks this operation from completing.

Additional Information

Logs

2018-08-26.desktop.production.log

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:38 (7 by maintainers)

github_iconTop GitHub Comments

272reactions
stevewardcommented, Aug 28, 2018

@simhox thank you for updating the issue body and uploading the log file! Here’s the related error:

fatal: Unable to create 'C:/Alles/Programme/react/todoapp/todo/.git/index.lock': File exists.

This often happens when Git crashes unexpectedly. What you will want to do to resolve this is go to the hidden .git directory show in the error message and delete the index.lock file located there. You will need to enable viewing hidden files and folders on Windows. After deleting that index.lock file you should be able to commit using GitHub Desktop again.

Let me know if you run into any further issues.

18reactions
mrPrazcommented, Oct 2, 2018

Deleting the index.lock file sorted this issue for me. I also made sure to restart the Git Desktop Client as well. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A lock file already exists in the repository, which blocks this ...
Step 1: Go to the desired folder · Step 2: Go to folder options · Step 3: Tick on show hidden files/folder ·...
Read more >
Git - A lock file already exists in the repository, which blocks ...
Steps to Reproduce · Add Local Repository. Choose Repository. Get redirected to create a new repository. · Create a new repository in the...
Read more >
A lock file already exists in the repository, which ... - YouTube
Git Hub Error A lock file already exists in the repository, which blocks this operation from completing :Fix the error: A lock file...
Read more >
A Lock File Already Exists in the Repository - Feeding Trends
A lock file already exists in the repository, which blocks this operation from completing. Now, we will solve this error in our blog....
Read more >
Understanding and Using Git's index.lock File | Pluralsight
This error alludes to the creation of an index.lock file within your hidden .git directory. In this guide, you will learn about the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found