Git error when trying to commit from Visual Studio

2019-06-22 05:18发布

I am getting an error when I am trying to do a commit from 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.

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)

3条回答
神经病院院长
2楼-- · 2019-06-22 05:36

No, you need to add that file to your .gitignore.

Simply create a .gitignore that contains the following :

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

查看更多
3楼-- · 2019-06-22 05:38

I had the same problem but with .opendb files. Added *.opendb to my ignore list worked wonders. Thanks for the help.

查看更多
在下西门庆
4楼-- · 2019-06-22 05:53

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

查看更多
登录 后发表回答