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

后端 未结 15 1195
小鲜肉
小鲜肉 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:37

    My automatically generated .gitignore file contained /.vs instead of .vs/. Fixing this typo fixed the problem!

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

    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

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

    Just add the .vs folder to the .gitignore file.

    Here is the template for Visual Studio from GitHub's collection of .gitignore templates, as an example:
    https://github.com/github/gitignore/blob/master/VisualStudio.gitignore


    If you have any trouble adding the .gitignore file, just follow these steps:

    1. On the Team Explorer's window, go to Settings.

    1. Then access Repository Settings.

    1. Finally, click Add in the Ignore File section.

    Done. ;)
    This default file already includes the .vs folder.

    0 讨论(0)
  • 2020-12-12 10:40
    1. .vs folder should not be committed.
    2. create a file with name ".gitignore" inside the projects git root directory.
    3. Add the following line ".vs/" in ".gitignore" file.
    4. Now commit your project.

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

    dotnet now includes a command for gitignore.

    Open cmd.exe from your project folder and type:

    dotnet new gitignore
    
    0 讨论(0)
  • 2020-12-12 10:50

    For me steps below helped:

    • Close Visual Studio 2019
    • Delete .vs folder in the Project
    • Reopen the Project, .vs folder is automatically created
    • Done
    0 讨论(0)
提交回复
热议问题