Search code examples
visual-studiotfstfvctfignore

Can I set a .tfignore file per solution if my repository contain many of solutions?


I have 2 solution in my repository: "A" and "B" under main\A & main\B the problem that I'm trying to solve is that when I'm changing some file in "A" I can see those file and deliver them when I'm working solution "B".

Can I set a .tfignore file per solution and have it ignore all the other files that does not exist out side of the current solution?

If "A" have his own build definition in TFS, Can I enforce the change-set to include only files from "A" folder?


Solution

  • .tfignore could not achieve what your want. You could use below workarounds:

    Best practice: A developer can check in pending changes limited to a given folder/branch/solution by right-clicking the folder/solution, choosing "Check in". For that check-in action, the "Pending Changes" view will temporarily "exclude" any changes made outside of that folder/branch/solution until you complete the check-in.

    Can it be prevented: There is a premade Check-in Policy option known as "Enforce check-in to only contain files that are part of current solution". This may work for you, since you are using "Solutions".

    enter image description here

    More details info please refer this simialr question: Why does TFS allow a single changeset to affect multiple branches? If there isn't a very good reason, can this be prevented? and several ways per each project.