Reputation: 104781
I'm on VS Community 2017.
I'm trying to permanently ignore the packages folder from being checked-in. I went to Source Control Explorer, but the Cloak option in the file/folder's context menu, under Advanced is grayed out:
I tried adding a .tfignore
file in the root folder adding packages
and /packages
to it, but it didn't do the job.
Any ideas?
Upvotes: 4
Views: 2697
Reputation: 51153
Cloaking is the process of defining which folders or files should be ** ignored by the workspace on your development machine.**
Which may not be suitable for your situation. You could only cloak files/folders already in source control. If your packages folder is newly add in pending changes and not checked in, the cloak option should be grayed out.
Give a try with declaring below instead of only ignore \packages
in your .tfignore file and add a disableSourceControlIntegration in a NuGet.config file, try again.
\packages
!\packages\repositories.config
For more detailed steps please refer to this question: Get TFS to ignore my packages folder
Another way is only check the packages folder to TFS (without any files or sub-folders) and then do the cloaked operation.
More info about the nuget package restore/TFS please refer this tutorial-- Package Restore with Team Foundation Build
Upvotes: 4
Reputation: 4602
You can only cloak things that are committed to the server already and since you have a pending add on the packages folder, it is not.
The package folder is added byt the Package Manager, but you can configure it to skip that step by creating a NuGet.config file in the solution directory setting disableSourceControlIntegration
to true
.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Upvotes: 1