Visual Studio团队资源管理器列出了对我没有创建的文件的更改 [英] Visual Studio Team Explorer is listing changes to files I didn't make

查看:602
本文介绍了Visual Studio团队资源管理器列出了对我没有创建的文件的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我刚开始使用visual studio查找28次我从未打开过的文件。当我尝试撤消更改(右键单击并选择撤消)时,我会看到一个对话框进行确认。我点击是,然后没有任何反应。



我的一位同事说他有时会遇到这种情况,他没有从重新开始之外找到解决方案。因为这是如此不令人满意,是否有其他人知道这是为什么发生,或如何解决它?



我在Windows 10上使用Visual Studio 2015

解决方案

正如Edward Thomson 所评论的那样,这可能是行结束问题。



您可以运行 git diff -w 命令来验证文件中真正改变了什么,以了解您是否确实存在行结束问题。



-w 选项告诉git忽略空白和行结束符,如果这个命令没有显示出差异,你可能是问题的牺牲品线结束标准化。



详细解决方案请查看此博客: Git显示文件被修改,即使它没有改变



另请看一下Stackoverflow中的这个问题:尝试使用git filter-branch修复行结尾,但没有运气






更新



要撤消挂起的更改,请尝试使用下面的解决方法,在VS2013中打开解决方案,并使用VS2013撤消团队资源管理器中的挂起更改。最后在VS2015重新打开它。待处理的更改将消失。

详细信息请参阅MSDN中的类似问题: VS2015和TFS Git - 无法撤消更改


For Example, I just started visual studio to find 28 changes to files I've never even opened. When I try to undo the changes (right clicking and selecting undo), I get a dialog box to confirm. I click yes, and then nothing happens.

A colleague of mine says this happens to him sometimes and he hasn't found a solution outside of starting over. Since that's so unsatisfying, does anyone else know why this is happening, or how to fix it?

I'm using Visual Studio 2015 on Windows 10

解决方案

Just as Edward Thomson commented,it's probably a line ending issue.

You could run git diff -w command to verify what is really changed in files to understand if you really have a Line Ending Issue.

The -w options tells git to ignore whitespace and line endings, if this command shows no differences, you are probably victim of problem in Line Ending Normalization.

Detail solution please check this blog: Git showing file as modified even if it is unchanged

Also take a look at this question in Stackoverflow: Trying to fix line-endings with git filter-branch, but having no luck


Update

To undo the pending changes, try to use below workaround, open the solution in VS2013 and undo the pending changes in the Team Explorer with VS2013. Finally reopen it in VS2015. The pending changes will go away.

Details please refer a similar question in MSDN: VS2015 and TFS Git – can’t undo changes

这篇关于Visual Studio团队资源管理器列出了对我没有创建的文件的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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