Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 15.3.0 git changes include "storage.ide" even though .vs/ in .gitignore

I upgraded VS 2017 to 15.3.0 a few days ago. Since then file "storage.ide" has remained in my modified files, even through I have used a suggested .gitignore for VS, which includes the .vs/ folder. This includes the following.

# Visual Studio 2015 cache/options directory .vs/ 

I then added the following to be more specific about ignoring this from the list of files to be tracked

.vs/SIASAWeb/v15/sqlite3/storage.ide .vs/**/storage.ide 

The Changes in the Team Explorer shows the following:

<project folder>   .vs/<project>/v15/sqlite3     storage.ide 

I have tried to git reset this file, but this then returns on the next commit, and also exists in all branches which I open, resulting in this then preventing the easy shift from one branch to another even if no changes were made.

In the Solution Explorer the "applicationhost.config" and ".suo" files are marked as "ignored", but "storage.ide" is marked as "pending edit".

I have tried committing, synced to the GitHub server, closing and re-opened VS, and even rebooting the computer.

My question is why this file is being maintained as a modified file, even though it should be ignored for git.

like image 398
Roger Layton Avatar asked Aug 21 '17 16:08

Roger Layton


People also ask

What is storage IDE?

IDE (Integrated Drive Electronics) is an electronic interface standard that defines the connection between a bus on a computer's motherboard and the computer's disk storage devices.

Should I include .VS in git?

Yes, you can add . vs folder to . gitignore - in fact you should do this on the beginning.

How do I ignore files in git using Visual Studio?

Visual Studio GitIn the Git Changes window, right-click any changed file that you want Git to ignore and choose Ignore this local item or Ignore this extension.

How do I remove ignored files from Git Visual Studio?

If you want to remove these files from your repository, you need to use git rm (or git rm -r to recursively remove a directory and its contents).


1 Answers

To fix this, if you got to the Team Explorer tab and click on the Manage Connections button (the green one a the top) you will see a list of local Git Repositories.

Right click on the repository you want to stop tracking the storage.ide file on and select Open Command Prompt.

You should then be able to type the following:

git rm --cached -r .vs 

This removes the .vs folder and its contents and subdirectories from being tracked in git.

like image 108
Liam Avatar answered Sep 22 '22 13:09

Liam