TFS/Git 扩展似乎忽略了 .gitignore [英] TFS/Git extensions seems to ignore .gitignore

查看:17
本文介绍了TFS/Git 扩展似乎忽略了 .gitignore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行带有Visual Studio Tools for Git"扩展的 VS 2013 Update 3.此扩展适用于团队资源管理器和 Git 的用户,我没有安装和运行其他与 Git 和 TFS 相关的扩展.我使用 关闭 VS、删除文件并再次重新启动 VS 解决了问题.

I'm running VS 2013 Update 3 with the 'Visual Studio Tools for Git' extension. This extension is for users of both team explorer and Git and I have no other Git and TFS related extensions installed and running. I use Microsoft's TFS Cloud service to backup and share my work.

Everything worked as expected for a few months. I want to be able to use this VS extension again, but the problem is that the files that should be ignored by .gitignore are being included by default. The same Git repository when viewed from the command line does not have this problem and works as expected.

Possibly important: I have at one time half-way set up a straight TFS account online but never used it locally and that never correlated with any problems I have mentioned here. Also, a long time ago I had to follow the advice in another posting to remove these binary files from version control because I added the .gitignore file too late. Since the command line doesn't have this problem I think something else is at work and that --hard reset actually worked as intended.

What is the problem with VS? Is there some way to change a setting or generally correct the oversight to ignore the files in the .gitignore file in the Git directory but not ignore the .gitignore file?

To head off some potential questions: I confirmed that the directories, and branches are the same on both interfaces by observing that all changes are added to Git/TFS and Posh Git as well as Git Bash and all other Git interfaces I have tried. The only problem is that additional files that should be ignored are not ignored in the VS extension.

Here is a sample of the .gitignore file that I use, which was produced by VS:

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/

解决方案

We recently had the the same problem with the VS2013 git provider ignoring the .gitignore for only a few files. It turned out, there was ms-persist.xml in the .git folder with the two relevant sections <TrackedFiles> and <IgnoredFiles>.

As suggest in a blog post by Eric Nelson closing VS, deleting the file and restarting VS again solved the problem.

这篇关于TFS/Git 扩展似乎忽略了 .gitignore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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