e-mre
e-mre

Reputation: 3383

What happened to "Exclude from Source Control" in VS2012

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.)

Upvotes: 15

Views: 14744

Answers (6)

PGardockiDotNet
PGardockiDotNet

Reputation: 11

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.

Upvotes: 0

Awesomni.Codes
Awesomni.Codes

Reputation: 2428

This is the easiest solution:

1. Select the file(s) in Solution Explorer

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

Path To Exclude

and here it is

Here is the Exclude

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

Upvotes: 9

Sam.Pratt
Sam.Pratt

Reputation: 59

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.

Upvotes: 5

e-mre
e-mre

Reputation: 3383

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)

Upvotes: 14

Softlion
Softlion

Reputation: 12615

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.

Upvotes: 9

KMoraz
KMoraz

Reputation: 14164

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.

!Excluded Changes

Upvotes: -2

Related Questions