Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

sqlite

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` 
like image 843
Prashanth Bichala Avatar asked May 24 '17 14:05

Prashanth Bichala


2 Answers

it's showing up as uncommitted? If that's the case then adding it to .gitignore changes nothing because .gitignore only works for untracked files (files that git hasn't been tracking so far.... if a file has already been committed on a previous revision [and therefore is part of HEAD] then .gitignore changes nothing).... so, two approaches are to be followed:

  • Keep the file on the project but specifically ask git to not care if it changes. Then you can do git update-index --assume-unchanged somefile

  • Remove the file from the history of the branch. This is quite a different endeavor and requires rewriting the history of the branch (or branches) Completely remove file from all Git repository commit history

like image 145
eftshift0 Avatar answered Sep 20 '22 14:09

eftshift0


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"
like image 23
curiousBoy Avatar answered Sep 18 '22 14:09

curiousBoy