Reputation: 153
I am trying to commit&push my project changes from a C# project using Visual Studio 2017 to my private gitea repository. Unfortunately build outputs like bin, debug but also the VS cache folder .vs is always beeing added to the change list.
When i type 'git add .' i get the following error:
error: open(".vs/xyz/v15/Server/sqlite3/db.lock"): Permission denied
error: unable to index file .vs/xyz/v15/Server/sqlite3/db.lock
fatal: adding files failed
to me the problem is clear. Git tries to add the .vs subfolder to the change list, but is not able to do so because Visual Studio has a lock on the database.
I have downloaded a .gitignore file from here:
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
copied it to the root of the project folder and renamed it to .gitignore. I checked the permission of this file and the folder, and the user has full write permissions (i am using Windows 10 by the way).
In the command line i have done this:
git rm -r --cached .
Which removed all my source files from the repository. I commited this changed with
git commit -am "removed source files"
and readded and commited my git igore file with
git add .\.gitignore
git commit -am "readded gitignore"
when i use the command
git check-ignore -v .vs
i get no output, which somehow tells me, that the gitignore file is not used by git.
I am using git for windows version 2.17.1.windows.2. Additionally i have tortoiseGit installed, which i use for other projects (i'm not sure it it interferes with git so i mention it).
Upvotes: 2
Views: 2443
Reputation: 153
ok, i got the issue resolved! This one was a tricky one. According to my Notepad++ the .gitignore file encoding was set to "UCS2 BE BOM". I converted the encoding to UTF-8 and voila i was able to add my files.
Upvotes: 2