A lock file already exists in the repository, which blocks this operation from completing.
See original GitHub issueDescription
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
- Add Local Repository. Choose Repository. Get redirected to create new repository.
- create new repository in project folder
- 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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:38 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@simhox thank you for updating the issue body and uploading the log file! Here’s the related error:
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.
Deleting the index.lock file sorted this issue for me. I also made sure to restart the Git Desktop Client as well. Thanks.