Trying to undo/ignore by adding slnx.sqlite file in .git-ignore file in visual studio 2017,But still it shows uncommitted.

Viewed 24213

as am working on a project in visual studio and am trying to commit the changes and i have added the files in the .gitignore which i do not want to commit them. as well as i have added /.vs/slnx.sqlite in the .gitignore file but still it is showing as an uncommitted file. what i have to do. Please help me with this problem

    `/.vs/angular2-research/v15
    /.vs/config/applicationhost.config
    /.vs/slnx.sqlite
    /.vs/slnx.sqlite-journal
    /cleanui/cleanui-admin-template-angular/node_modules
    /cleanui/.vs
    /.vs
    slnx.sqlite
    *.sqlite
    /.vs/*.sqlite
    .vs/*.sqlite` 
5 Answers

Just keep that in mind that those files stores some local user settings and preferences for projects (like what files you had open). So every time you navigate or do some changes in your IDE, that file is changed and therefore it checks it out and show as there are uncommitted changes.

For the slnx.sqlite, I just got rid off it completely like following:

git rm {PATH_OF_THE_FILE}/slnx.sqlite -f
git commit -m "remove slnx.sqlite"

You see the file in uncommitted changes because that file is already committed in Git repository and on a local build it has some changes again which shows up in uncommitted changed.

To avoid this delete the file from local repo and push the changes to git server repo. gitignore works for only new files which are not yet in git repo.

Thanks

I was getting the same when i created a new project in Visual Studio 2019. I added "2019" in following line in my gitignore file. This worked for me.

# Visual Studio 2015/2017/2019 cache/options directory
.vs/
Related