Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I exclude a specific file from TFS source control

Tags:

tfs

We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies the correct config file to app.config. Obviously the configuration specific files are in source control --- but at the moment so is App.Config, and that shouldn't be.

How can I mark that one file as excluded from source control, but obviously not from the project.

I'm using VS 2005, and 2005 Team Explorer.

like image 614
Ralph Shillington Avatar asked Sep 02 '09 18:09

Ralph Shillington


People also ask

What is exclude file?

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

How do I exclude files from a folder?

(2) Go to the "Settings" tab and Click "Exclude files and locations". Then, click "Browse". (3) Here, at this step, you can use either a file or a folder. Select a file or a folder and click OK.


2 Answers

It's easy in TFS2012, create a .tfignore file

http://msdn.microsoft.com/en-us/library/tfs/ms245454%28v=vs.110%29.aspx#tfignore

###################################### # Ignore .cpp files in the ProjA sub-folder and all its subfolders ProjA\*.cpp #  # Ignore .txt files in this folder  \*.txt # # Ignore .xml files in this folder and all its sub-folders *.xml # # Ignore all files in the Temp sub-folder \Temp # # Do not ignore .dll files in this folder nor in any of its sub-folders !*.dll  # EDIT https://msdn.microsoft.com/en-us/library/ms245454(v=vs.110).aspx#tfignore # A filespec is recursive unless prefixed by the \ character. 
like image 83
artfulhacker Avatar answered Oct 19 '22 09:10

artfulhacker


Select the App.config file in Solution Explorer, and choose File -> Source Control -> Exclude App.config from Source Control.

like image 45
PjL Avatar answered Oct 19 '22 10:10

PjL