How to get TFS to ignore all folders with a certain name

坚强是说给别人听的谎言 提交于 2019-12-05 18:22:14

问题


Starting with Visual Studio 2015 all solutions create a hidden ".vs" folder with various things under it like applicationhost.config, .suo files, etc...

For informational purposes I'm running TFS 2013 update 4 and I'm not in control of the system so I have no access to upgrade the system.

I know I could go to every solution folder and add a .tfsignore file there with ".vs*" or something similar to ignore the folder but what I'm looking for is how to add a .tfsignore at the root that will ignore all ".vs" folders and the files under them no matter where they are located in the various sub directories.

Thanks.


回答1:


You can put a .vs declaration in a .tfignore file that is in the parent folder of all solution files. This will take precedence over lower files.

No wildcards such as * are required. Also, .tfignore files use backslashes \ instead of /.




回答2:


With TFS Power Tools, you can add Forbidden Patterns Policy, Team->Team Project Settings->Source Control Settings, i.e.^(.+\.vs$)




回答3:


The effects of the .tfignore file are recursive. Of course, you can also create .tfignore files in sub-folders to override the effects of a .tfignore file in a parent folder.

Moreover, you can also use Forbidden Patterns Policy as TfsAgent mentioned.You will get a policy warn.But the files you forbidden (ex .vs, .dll) still in included changes.You need to excluded them all by manually.Then undo the pending changes. By note,you need to install TFS Power Tools 2015



来源:https://stackoverflow.com/questions/33264703/how-to-get-tfs-to-ignore-all-folders-with-a-certain-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!