views:

959

answers:

3

Is it possible to set up files/folders to ignore on a per-project basis in tfs source control?

For example, I've a website with an assets folder that I do not want to go in to source control. These assets are maintained by a separate system. Also, I don't not want to put several gigabytes of assets into source control, but I need a couple of samples on my dev machine, but I don't want to check those in either.

If I'm working on this website in while bound to source control and I refresh the tree, these files will automatically get added again, I want to prevent this from happening.

+2  A: 

Are you refering to Cloaking?

Alex
no, I've clarified my question, sorry
Dave
Why was this downvoted? Alex was doing his best to answer the OP unedited question, which was a little vague. Regardless, his answer is still a possbily useful one, and doesn't contain anything that could be construed as negative.
+3  A: 

I'm going to assume you are using Web Site Projects. These automatically crawl their project directory and throw everything into source control. There's no way to stop them.

However, don't despair. Web Application Projects don't exhibit this strange and rather unexpected (imho: moronic) behavior. WAP is an addon on for VS2005 and comes direct with VS2008.

As an alternative to changing your projects to WAP, you might consider moving the Assets folder out of Source control and into a TFS Document Library. Only do this IF the project itself doesn't directly use the assets files.

Chris Lively
yes, your assumption is correct. I thought that would be the case, just wanted to be doubly sure I didn't miss anything.
Dave
+3  A: 

It does seem a little cumbersome to ignore files (and folders) in Team Foundation Server. I've found a couple ways to do this (using TFS / Team Explorer / Visual Studio 2008). These methods work with the web site ASP project type, too.

One way is to add a new or existing item to a project (e.g. right click on project, Add Existing Item or drag and drop from Windows explorer into the solution explorer), let TFS process the file(s) or folder, then undo pending changes on the item(s). TFS will unmark them as having a pending add change, and the files will sit quietly in the project and stay out of TFS.

Another way is with the Add Items to Folder command of Source Control Explorer. This launches a small wizard, and on one of the steps you can select items to exclude (although, I think you have to add at least one item to TFS with this method for the wizard to let you continue).

You can even add a forbidden patterns check-in policy (under Team -> Team Project Settings -> Source Control... -> Check-in Policy) to disallow other people on the team from mistakenly checking in certain assets.

Derek Morrison