简体   繁体   English

尝试从Visual Studio 2015提交时出现Git错误(文件opensdf)

[英]Git error when trying to commit from Visual Studio 2015 ( file opensdf)

I am getting an error when I am trying to do a commit from Visual Studio 2015: 我尝试从Visual Studio 2015进行提交时收到错误:

An error occurred. 发生错误。 Detailed message: Could not open 'C:/ABC/DEFG-windows-universal/AAAA.Win10.opensdf': The process cannot access the file because it is being used by another process. 详细消息:无法打开'C:/ABC/DEFG-windows-universal/AAAA.Win10.opensdf':进程无法访问该文件,因为它正由另一个进程使用。

I have tryied to reboot, and to delete the file but I have the same issue. 我试图重新启动,并删除该文件,但我有同样的问题。 Do I need to use the command line to commit my changes? 我是否需要使用命令行来提交更改? (I am pushing to Master and I am the only one working on this app) (我正在推动Master,我是唯一一个在这个应用程序上工作的人)

No, you need to add that file to your .gitignore . 不,您需要将该文件添加到.gitignore

Simply create a .gitignore that contains the following : 只需创建一个包含以下内容的.gitignore

*.opensdf

Easier, though, is to let Visual Studio create the default .gitignore in your repository, or download the default Visual Studio .gitignore and add it to your project. 但是,更容易让Visual Studio在您的存储库中创建默认的.gitignore ,或者下载默认的Visual Studio .gitignore并将其添加到您的项目中。

Adding the locked file to gitignore isn't an option for me because I want it versioned but I may not need to commit it frequently with other minor changes I'm making. 将锁定的文件添加到gitignore对我来说不是一个选项,因为我想要它的版本,但我可能不需要经常提交它与我正在进行的其他微小更改。 Even if I temporarily exclude locked files it still won't let me commit unlocked ones. 即使我暂时排除锁定的文件,它仍然不会让我提交解锁的文件。 This is indeed very annoying. 这确实很烦人。

What I find works for me is use of another Git client to commit files outside of VS2015. 我发现对我有用的是使用另一个Git客户端来提交VS2015之外的文件。 Also not a perfect solution but it does the job. 也不是一个完美的解决方案,但它完成了工作。 The only other solution I found is closing VS, opening it again and committing files before doing anything else. 我找到的唯一其他解决方案是关闭VS,再次打开它并在执行任何其他操作之前提交文件。

I had the same problem but with .opendb files. 我有同样的问题,但有.opendb文件。 Added *.opendb to my ignore list worked wonders. 将* .opendb添加到我的忽略列表中,创造了奇迹。 Thanks for the help. 谢谢您的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM