简体   繁体   English

在 vscode 中使用 TFS 时如何排除文件夹?

[英]How to exclude folders when using TFS in vscode?

I am using Visual Studio Team Services extension in VS code for check in. https://marketplace.visualstudio.com/items?itemName=ms-vsts.team我在 VS 代码中使用 Visual Studio Team Services 扩展进行签入。 https://marketplace.visualstudio.com/items?itemName=ms-vsts.team

I am now trying to check in change in angular project, but I am annoyed by excluded 16000 files which are from node_modules:我现在正在尝试检查 angular 项目中的更改,但我对来自 node_modules 的排除 16000 个文件感到恼火: 在此处输入图片说明

How can I exclude those files from source control?如何从源代码管理中排除这些文件? In Visual Studio I used .tfignore file, how about vscode?在 Visual Studio 中我使用了 .tfignore 文件,vscode 怎么样?

I had the same problem creating a dotnet core 2 cli react project using visual studio code and TFVC.我在使用 Visual Studio 代码和 TFVC 创建 dotnet core 2 cli react 项目时遇到了同样的问题。 I created a .tfignore file in the root (same place as the .gitignore).我在根目录中创建了一个 .tfignore 文件(与 .gitignore 相同的位置)。

Then I copied the content in the .gitignore file into .tfignore file, save and done...然后我将 .gitignore 文件中的内容复制到 .tfignore 文件中,保存并完成...

So I followed everything that the others mentioned, but was missing the following, for .tfignore to skip the files:所以我遵循了其他人提到的所有内容,但缺少以下内容,以便.tfignore跳过文件:

Place the following in you Visual Studio Code's settings.json file.将以下内容放入 Visual Studio Code 的settings.json文件中。

"tfvc.restrictWorkspace": true

settings.json location: settings.json位置:

File - Preferences - Settings (top right-hand corner(Open Settings (JSON)))文件 - 首选项 - 设置(右上角(打开设置(JSON)))

That I found the answer here .我在这里找到了答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM