Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I permanently exclude the bin and obj folders from TFS 2012 checkin?

I mucked around with TFS settings and I accidentally included the bin and obj folders for TFS 2012 checkin, and even checked them in already. I don't want this because these files change often and aren't meant for inclusion.

I've checked What happened to "Exclude from Source Control" in VS2012. The accepted answer doesn't work because the bin & obj folders and the DLLs inside those folders don't appear in the "Promote Candidate Changes" list, even after excluding them. The second most popular answer also doesn't work permanently. I press yes to all and it removes them from the included changes list, but when I do any action involving rebuilding, they're added to include list again.

I'm looking for a permanent solution which will permanently exclude these folders and the files inside from checkin, and if possible also removes them from the TFS server.

like image 951
Nzall Avatar asked Jan 21 '14 13:01

Nzall


People also ask

Can I delete BIN and OBJ folders?

Delete bin and obj foldersThe bin and obj folders are usually safe to delete since they are automatically generated when the solution/project is being build by Visual Studio/MSBuild. This feature is off by default, but can easily be enabled in the settings.


1 Answers

TFS 2012 has the option to drop a .tfIgnore file in your workspace.

Visual studio has a UI to create the file for you:

While you can manually create a .tfignore text file using the above rules, you can also automatically generate one when the Pending Changes page has detected a change.

To automatically generate a .tfignore file

  • In the Pending Changes page, in the Excluded Changes section, choose the Detected changes link.

  • The Promote Candidate Changes dialogue box appears.

  • Select a file, open its context menu, and choose Ignore this local item, Ignore by extension, or Ignore by file name.

  • Choose OK or Cancel to close the Promote Candidate Changes dialog box.

  • A .tfignore file appears in the Included Changes section of the Pending Changes page. You can open this file and modify it to meet your needs.

  • The .tfignore file is automatically added as an included pending change so that the rules you have created will apply to each team member who gets the file.

Or create it from the command line using echo . > .tfIgnore and then open it using notepad.

Another trick is to name the file .tfIgnore. in explorer and save it. You'll probably be prompted if you want to change the extension, the answer, in this case, is: yes.

like image 180
jessehouwing Avatar answered Sep 22 '22 01:09

jessehouwing