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

风流意气都作罢 提交于 2019-11-27 02:04:09

问题


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.


回答1:


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.




回答2:


For Excluding Bin folders ,Tick "Show Solution Changes" Under View options in "Included Changes"




回答3:


I called in the help of our TFS admin.

We couldn't make a .tfignore file, but what did work was the following:

  1. Check in both folders in TFS;
  2. Delete the dlls and pdbs which are unique to the project from the source control explorer and check in this change.
  3. Rebuild the project locally, try to check in and confirm that there are no pending changes.

the dependent assemblies remain in TFS, but since these rarely change, this isn't a big issue.



来源:https://stackoverflow.com/questions/21260039/how-do-i-permanently-exclude-the-bin-and-obj-folders-from-tfs-2012-checkin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!