Visual Studio 2017 15.3.0 git 更改包括“storage.ide".即使 .vs/在 .gitignore [英] Visual Studio 2017 15.3.0 git changes include "storage.ide" even though .vs/ in .gitignore

查看:24
本文介绍了Visual Studio 2017 15.3.0 git 更改包括“storage.ide".即使 .vs/在 .gitignore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我将 VS 2017 升级到 15.3.0.从那时起,文件storage.ide"一直保留在我修改过的文件中,即使我使用了 建议的 .gitignore 用于 VS,其中包括 .vs/文件夹.这包括以下内容.

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

我曾尝试 git 重置此文件,但这会在下一次提交时返回,并且还存在于我打开的所有分支中,导致即使没有进行任何更改,也可以防止从一个分支轻松转移到另一个分支.

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.

在解决方案资源管理器中,applicationhost.config"和.suo"文件被标记为忽略",但storage.ide"被标记为待编辑".

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

我尝试过提交、同步到 GitHub 服务器、关闭并重新打开 VS,甚至重新启动计算机.

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

我的问题是为什么这个文件被维护为一个修改过的文件,即使它应该被 git 忽略.

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

推荐答案

要解决这个问题,如果您进入 Team Explorer 选项卡并单击 Manage Connections 按钮(顶部的绿色按钮),您将看到一个列表本地 Git 存储库.

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.

右键单击要停止跟踪 storage.ide 文件的存储库,然后选择打开命令提示符.

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

这会从 git 中删除 .vs 文件夹及其内容和子目录.

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

这篇关于Visual Studio 2017 15.3.0 git 更改包括“storage.ide".即使 .vs/在 .gitignore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆