1

I am attempting to commit some new files to a GitHub repository, and have run into an issue; Visual studio won't let me commit. When I Try, I get the following error:

Git failed with a fatal error.
error: open(".vs/SAPS/v15/Browse.VC.opendb"): Permission denied
fatal: Unable to process path .vs/SAPS/v15/Browse.VC.opendb

My first response was that I needed to pull first, and I was able to pull successfully. However, this didn't fix the problem in the slightest.

A quick search for similar problems yielded an issue that appears to be related:

GitHub Commit Error: Permission denied fatal: Unable to process path ~/App_Data/aspnet-MyProject.mdf

The problem in this issue is that the asker tried to commit mdf files. However, near as I can tell, I'm not using any such files. The files I am trying to commit are .cpp and .h files. However, Visual studio created some additional files in the solution that may be causing problems. The files Visual Studio added by itself are mostly .db and .opendb files. Frankly, I don't even know what those are, and some of them appear to exist outside of the solution I am trying to use.

I would appreciate it if someone could explain to me why I am unable to commit my changes, even though I am perfectly able to pull other changes. Thanks.

Globin347
  • 177
  • 2
  • 9
  • This image shows the file structure that is visible in the team explorer: https://pbs.twimg.com/media/DaTBWCAVAAAezQp.jpg:large – Globin347 Apr 08 '18 at 23:22

2 Answers2

1

you should have added to ignore the whole .vs subdirectory. It is internal cache of vs

do it now, and untrack it

ps: the error happens because VS opens the file exclusively, so git cannot read it

PPS: I seem to be able to add directory to ignore just from team explorer's rightclick menu:

Screenshot of ignoring directory

or you can always create or edit the .gitignore file yourself.

Probably you will have to install git for windows to use command-line. Though there is some git.exe deep inside vs installation, maybe you could use that one as well. Try "Action"->"Open command prompt" in the team explorer, if the git available there.

max630
  • 8,762
  • 3
  • 30
  • 55
  • Thanks for the tip, but I'm still a bit unsure what to do, as I'm not super familiar with the innermost workings of visual studio. Should I try to use gitignore from inside visual studio itself, or from the repository on github? In either case, where do I enter the command? is there a terminal I should type it in? – Globin347 Apr 09 '18 at 19:56
  • Added to answer – max630 Apr 10 '18 at 05:53
0

You can create a .gitignore file in the repository. Inside of the file put .vs - this will let your git software ignore any .vs file extensions, which is whats creating the permission denied.