There is one file that I always made changes to, but that I never want to be checked in. I would like TFS to block me from ever checking it in or committing the changes. How can I configure TFS to do this?
Details:
There is another developer on the project that has checked in some bad code that I prefer to comment out on my local machine. Since they are a client, I prefer to keep this a technical exercise rather than make it a political one.
Best Answer
One of TFS undervalued features is cloaking. Like SVN's
ignore
, cloaking will let you ignore a certain folder or files.Cloaking a Folder
Cloaking a folder is easy: just right click a folder on the source control explorer and select
Cloak
Cloaking a File
The UI doesn't expose cloaking on a single file, but sometimes you may want to cloak a certain file like
app.config
.Go to
File
>Source Control
>Workspaces
Select your workspace and click
Edit
.Under the working folders, and a new entry with status
Cloaked
and enter the full server path of the file you want to cloak. (E.g.:$/MyTeamProject/Dev/Src/SomeProject/app.config
)Using Local Workspace .tfignore file (In TFS 2012, 2013, 2015 and up)
In Local Workspace, use you can use
.tfignore
file (the equivalent of.gitignore
for Git)Blocking by Permissions
Another approach is deny check-in on the file (requires administrative privileges):
Right click the file > click
Properties
>Security
Add your user and mark
Deny
on theCheck In
permission.