VS 2017 Git Local Commit DB.lock error on every commit

后端 未结 15 1196
小鲜肉
小鲜肉 2020-12-12 10:35

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\"): P

相关标签:
15条回答
  • 2020-12-12 10:52

    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

    0 讨论(0)
  • 2020-12-12 10:53

    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...

    0 讨论(0)
  • 2020-12-12 10:56

    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 )

    0 讨论(0)
  • 2020-12-12 10:58

    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:

    1. Delete the .gitignore file from your project folder
    2. Go to Team Explorer
    3. Go to Home in Team Explorer
    4. Go to Settings
    5. Under GIT, Click Repository Settings
    6. Under - Ignore & Attributes Files - Under Ignore File - Click Add. You should see a notification that the Ignore File has been successfully created
    7. Build your solution. It will take a little while and create a new .ignore file once build is successful
    8. You should now be able to Commit and Push without any further issue

    NB: Bear in mind that your version of visual studio might place these options differently. I am using Visual Studio 2019 Community Edition.

    0 讨论(0)
  • 2020-12-12 11:00

    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.

    0 讨论(0)
  • 2020-12-12 11:01

    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.)

    0 讨论(0)
提交回复
热议问题