26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• A baseless merge is being conducted in which the branch file relationships are not<br />

known to TFS.<br />

The merge tool shows you the details for each conflict and allows you to choose which<br />

change you want to keep in the final merged file. You can choose to keep the source<br />

change, keep the destination change, integrate both changes, or manually modify the final<br />

version by typing directly into the file.<br />

After resolving every conflict in the file, save the final version as a pending change to be<br />

checked into the target branch.<br />

Be careful when merging because it is easy to make mistakes that might result in build<br />

instability. After you have finished merging, compile the resulting source and run unit<br />

tests to test for major breaks.<br />

Additional Resources<br />

• For more information about resolving conflicts, see “How to: Resolve Conflicts” at<br />

http://msdn2.microsoft.com/en-us/library/ms181433(VS.80).aspx<br />

How do I avoid conflicts?<br />

Most conflicts can be automatically resolved by <strong>Team</strong> <strong>Foundation</strong> Version Control. The<br />

scenarios in which you are most likely to need a manual merge―and therefore are worth<br />

avoiding―are scenarios in which there are overlapping changes to the same lines of<br />

code, or where more than two developers are working on a file at the same time.<br />

To view pending changes<br />

1. In Source Control Explorer, right-click the solution, project, folder, or file for which<br />

you want to see pending changes.<br />

2. Select View Pending Changes.<br />

This method will show you all of the pending changes <strong>with</strong>in the scope you have<br />

selected.<br />

If you use the command line checkout tool, it will indicate which other users have<br />

checked out this file, including information about the nature of the users’ pending<br />

changes. In the following example, a file named Math.cs is checked out, and TFS<br />

provides a notification that two other users (James and Sally) are working on the file. The<br />

notification indicates exactly what type of pending change each user has in his or her<br />

local workspace (Edit and Rename) and confirms that the local version of the file (the<br />

current workspace version) is not based on the latest repository version.<br />

c:\dev\projects\calc\src>tf edit math.cs<br />

ExplorerScc.cs

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!