每次提交时VS 2017 Git Local Commit DB.lock错误 [英] VS 2017 Git Local Commit DB.lock error on every commit

查看:112
本文介绍了每次提交时VS 2017 Git Local Commit DB.lock错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在每次本地提交时都会收到此错误:

We are getting this error on every local commit:

Git失败并出现致命错误.错误: open(.vs/XXXXXX.Dev.Library/v15/Server/sqlite3/db.lock"):权限 拒绝致命的:无法处理路径 .vs/XXXXXX.Dev.Library/v15/Server/sqlite3/db.lock

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

这是使用本地git存储库的VS 2017的全新安装,然后才能同步到Azure DevOps GIT.

This is a brand new installation of VS 2017 using the local git repository before it can sync to Azure DevOps GIT.

我们可以手动删除锁定文件,然后进行 sync 罚款,但这会严重减慢开发过程(必须 close 删除打开提交).

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?

推荐答案

只需将.vs文件夹添加到 .gitignore 文件.

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

以下是GitHub的.gitignore模板集合中的Visual Studio模板,例如:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

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

如果在添加.gitignore文件时遇到任何麻烦,请按照以下步骤操作:

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

  1. 在团队资源管理器"的窗口中,转到设置".

  1. 然后访问存储库设置.

  1. 最后,在忽略文件"部分中单击添加".

完成. ;)
该默认文件已经包含.vs文件夹.

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

这篇关于每次提交时VS 2017 Git Local Commit DB.lock错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆