I am searching for a possibility to exclude some files of my generated VS project file from TFS. I know that it is possibly afterwards with the .vspscc file.
But what i want is, that i can tell the VS project file, that some of it's files are not allowed to get added to TFS, before I add the project to TFS.
On the File menu, click Source Control, then click Exclude from Source Control. When you are ready to place the file under source control, you can access the File menu and click Source Control, then uncheck Exclude from Source Control.
If the project is a Web Site, Visual Studio excludes a file from the project by adding an extension ". exclude" to mark it as excluded. So all files will the extension ". exclude" will not be used in the project. ".
There are several levels of excluding files in TFS:
Add items to Folder
dialog.
On the Add items to Folder
dialog > Automatically exclude from source control
:
Note: the default items can be modified using the registry.
On the team project source control level using a check-in policy.
Source Control
> Mark a folder > Security
> Deny Check-In permission
Not sure about the accepted answer by KMoraz. #1 and #2 don't seem to be permanent, #3 doesn't even appear for me (I'm using VS2012), #4 and #5 require permissions (which I don't have on CodePlex) and #6 is not even relevant (because you cannot cloak something that isn't first checked-in).
I know your question is about BEFORE they are added, but I think the answer, which is to create a ".tfignore" file, only works for TFS 2012.
For me I had to locate the ".vspscc" file (which I know you already stated) in the project folder and look for this line:
"NUMBER_OF_EXCLUDED_FILES" = "0"
In my case I wanted to exclude TypeScript generated files, so I added this:
"NUMBER_OF_EXCLUDED_FILES" = "3"
"EXCLUDED_FILE0" = "app.js"
"EXCLUDED_FILE1" = "app.js.map"
"EXCLUDED_FILE2" = "app.min.js"
I really hope they get their head on straight and add the feature you're looking for to VS in a more accessible way.
... and yes, there's a menu for excluding files in "File->Source Control->Advanced", but it should be in a context menu, and it doesn't apply to NESTED files (such as the app.* ones above [for .ts files]).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With