Check-in each project separately?

2019-01-26 20:26发布

问题:

I have several projects hosted as separate TFS projects.

When I want to check-in changes, all the changes of all projects sum up together and commit as one check-in.

I want to handle the check-ins per project, so that the current check-in only commits the files of the current solution.

Here is what the TFS Pending Changes page looks like:

The red is "Project 1", the black is "Project 2", I don't want the black to be here at all.

回答1:

There are several options:

  1. You can create separate workspaces for each project and only map the directories that belong to said project, that way the changes will not be 'shared'. See this on how to create separate workspaces for each project.
  2. You can also right-click the project and choose the Check-in option from there.
  3. From the pending changes window, right-click any folder or item you don't want to check in (yet) and choose exclude to exclude them from this check-in.
  4. One more option to have the pending changes window auto-include the right files is to go to the source control explorer and right-click the folder containing just the project you want to check in and pick check-in from there.

The reason for checking in all changes as one is to make sure the comitted version in source control is in a consistent, buildable state. Should you want to use a Continuous Integration or even Gated checkin build on the build server component that goes with TFS, you might get into trouble when checking in the projects one by one.