Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
454 views
in Technique[技术] by (71.8m points)

tfvc - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...