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.
You can just simply select the file from your Source Control Explorer and Right Click on it, and the select the "Rename" option from there, and you can add ". exclude" at the end of the file name. And then do remember to check-in the file, and after that you can see that your file is excluded from Source Control.
The error you have is mainly caused when you're trying to check in files which is no longer exist on the machine. To resolve it, go to Source Control Explorer -> select these missing files -> Undo Pending Changes. Or you can just left these files in the Excluded Changes list to not checking them.
One of TFS undervalued features is cloaking. Like SVN's ignore
, cloaking will let you ignore a certain folder or files.
Cloaking a folder is easy: just right click a folder on the source control explorer and select Cloak
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
)
In Local Workspace, use you can use .tfignore
file (the equivalent of .gitignore
for Git)
.tfignore file example ###################################### # 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
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 the Check In
permission.
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