0

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?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Aviram Fireberger
  • 3,910
  • 5
  • 50
  • 69

2 Answers2

1

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

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Thanks, Does the "Check-in Policy" is a global setting? Does each developer need to set it manually in his IDE? – Aviram Fireberger Apr 20 '17 at 06:19
  • 1
    @AviramFireberger It's team project level, to complete this procedure, you must have the Edit project-level information permission set to Allow. After setting by team project administrator, other developers in the team project will be required to follow the policy. More details please refer: [Add Check-In Policies](https://www.visualstudio.com/en-us/docs/tfvc/add-check-policies) – PatrickLu-MSFT Apr 20 '17 at 06:29
  • Thanks I'll look at the Check-In policy documentation page – Aviram Fireberger Apr 20 '17 at 07:46
0

What you should actually do in this case is create two workspaces, one for each project. You can then switch between the workspaces as necessary and only see changed files within that workspace.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120