We are getting this error on every local commit:
Git failed with a fatal error.error: open(".vs/XXXXXX.Dev.Library/v15/Server/sqlite3/db.lock"): Permission deniedfatal: Unable to process path .vs/XXXXXX.Dev.Library/v15/Server/sqlite3/db.lock
This is a brand new installation of VS 2017 using the local git repository before it can sync to Azure DevOps GIT.
We can manually delete the lock file and then sync fine, but it seriously slows down the development process (having to close, delete, open, commit every time).
Does anyone know a better long-term fix for this issue?
This question is related to
git
visual-studio
Try to copy the file in to your directory manually (C:\Users\Admin\AppData\Local\Temp\WebSitePublish\digisol--1147805695\obj\Debug\Package\PackageTmp.vs\digisol\v15\Server\sqlite3 )
For me steps below helped:
To resolve this issue is simple. First Close, the Visual Studio and open the Windows Explorer, Go to location folder .vs and open folder properties and check the option hidden
My automatically generated .gitignore
file contained /.vs
instead of .vs/
. Fixing this typo fixed the problem!
Had this and my .gitignore was inside my project folder, but the main git folders were at the solution level. Moving .gitignore out to the solution/git level folders worked. Still not sure how it got there but...
I had done above solutions , finally this works solved my problem :
Close the visual studio
Run the git bash in the project folder
Write :
git add .
git commit -m "[your comment]"
git push
Step 1:
Add .vs/ to your .gitignore file (as said in other answers).
Step 2:
It is important to understand, that step 1 WILL NOT remove files within .vs/ from your current branch index, if they have already been added to it. So clear your active branch by issuing:
git rm --cached -r .vs/*
Step 3:
Best to immediately repeat steps 1 and 2 for all other active branches of your project as well.
Otherwise you will easily face the same problems again when switching to an uncleaned branch.
Pro tip:
Instead of step 1 you may want to to use this official .gitingore template for VisualStudio that covers much more than just the .vs path:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
(But still don't forget steps 2 and 3.)
if you are using an IDE like visual studio and it is open while you sending commands close IDE and try again
git add .
and other commands, it will workout
VS 2017 Git Local Commit DB.lock error on every commit
This issue must have been caused by a corrupt .ignore file.
If your IDE is Visual Studio please follow these steps to resolve this issue:
NB: Bear in mind that your version of visual studio might place these options differently. I am using Visual Studio 2019 Community Edition.
I had the same issue but I've resolved by creating the .gitignore file.
I've also found a workaround that simply consists on removing db.lock file from the .vs folder but you have to do it every single time and doing this for long makes this an annoying operation.
The best way to solve this issue is to create the .gitignore file as suggested before, but I think that is good to mention also this workaround, just to general knowledge purpose!
Regards, Tony Grinton
I'm not using Git directly thru Visual Studio but using the Git Desktop client.
I did however get a similar error but solved it by closing Visual Studio before Committing changes to master.
dotnet
now includes a command for gitignore
.
Open cmd.exe
from your project folder and type:
dotnet new gitignore
Source: Stackoverflow.com