What happened to “Exclude from Source Control” in VS2012

谁说我不能喝 提交于 2020-01-01 07:55:28

问题


I want to exclude some of the files in code folders from TFS 2012 source control.

Before VS2012 this was done by the "Exclude from source control" command available in "Source Control Explorer"s right-click menu. But in VS2012 I can not find it.

Does anybody know where it is ?

(I am using a "Local" workspace by the way.)


回答1:


When you click on "Detected Changes" in the Team Explorer pane, "Promote Candidate Changes" window opens. This window allows you to select among detected changes and promote them to a source controlled item.

In this "Promote Candidate Changes" window, you select a file (or multi select files with Shift), right-click on it and a context menu pops up which contains an "ignore this local item" option. If you you click on it, selected files are excluded from source control.

Visual Studio adds a file named ".tfignore" to the source control mapping root, which contains names of all files to be ignored by source control. (Previous TFS versions did not produce this file but they were all server workspaces. Since this is a "Local" workspace, filenames to be ignores need to be kept in the workspace)




回答2:


I have the real solution.

In the "team explorer" pane, in the "pending changes" tab, right click a new file you don't want in source control, and click "undo".

It will leave the file in the project, and exclude it from TFS. In the project window, the file will never have a "lock" icon on the left of its name.




回答3:


This is the easiest solution:

1. Select the file(s) in Solution Explorer

2. Go to File -> Source Control -> Advanced

and here it is

Keep in mind: If you right click a file in Solution Explorer you only find "the most important options" not all :)




回答4:


In VS2013 this is back but has been moved to the file menu: -

  • Select the file in the Solution Explorer
  • File > Source Control > Advanced > Exclude xxx.xxx from Source Control

I know that this is slightly off topic but thought it may help someone.




回答5:


I have Visual Studio 2017 Enterprise, and the option to exclude does not exist under File->Source Control. My solution to this problem was to open the Source Control Explorer, and remove the item I wanted to exclude.




回答6:


It's in the Pending Changes pane separated to Excluded Changes and Included Changes sections. It allows filtering and excluding or promoting items between sections.

!



来源:https://stackoverflow.com/questions/13765372/what-happened-to-exclude-from-source-control-in-vs2012

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