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.

• Merge scenarios – If you are undoing the check-in of a file that has very recently<br />

been checked in, you probably will not need to merge changes because it is unlikely<br />

that anyone else will have updated the item in the intervening period. However, if you<br />

want to undo a check-in, and the check-in to be undone is not the latest change to a<br />

file, a three-way merge is required. The current version on the server, the version you<br />

have in your workspace, and the version you want to roll back to must be merged<br />

together. If there are no conflicts, the changes from the version to be rolled back are<br />

extracted from the file, and any changes that came after that version are preserved.<br />

• Resolving conflicts – If you do need to perform a merge, the merge window is<br />

displayed. To resolve the merge, select the item and then click Merge. An automatic<br />

merge is initially attempted; if it fails, the merge tool is invoked to resolve the merge.<br />

The Auto-Merge All button attempts to automatically merge each of the items in the<br />

merge list, but does not attempt to invoke the merge tool.<br />

Additional Resources<br />

• To download the TFPT tool from MSDN, go to<br />

http://www.microsoft.com/downloads/details.aspx?FamilyID=7324C3DB-658D-<br />

441B-8522-689C557D0A79&displaylang=en<br />

• To learn more about the TFPT, see “Power Toy: tfptexe” at<br />

http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx<br />

How to Resolve a Conflict<br />

To resolve merge conflicts, use the <strong>Visual</strong> <strong>Studio</strong> merge tool. If a conflict is detected<br />

during a merge, you can resolve conflicts either automatically or manually. If you choose<br />

to resolve the conflict manually, you can keep the source changes, keep the target<br />

changes, or resolve the conflict in the merge tool.<br />

You might need to resolve conflicts when merging changes between branches, getting<br />

files into your workspace, or checking in new versions of files. There are three conflict<br />

types:<br />

• Version – The file has evolved along divergent paths. This could be the result of a<br />

file edit, rename, delete, or undelete operation.<br />

• File Name Collision – Two or more items are trying to occupy the same path.<br />

• Local Overwrite – Only occurs during a get operation, if you are trying to<br />

overwrite a local, editable file.<br />

Most conflicts can be resolved automatically; version conflicts are the only conflict type<br />

that might result in a manual merge operation. Manual merge is most common in the<br />

following scenarios:<br />

• A file has been edited in both branches, <strong>with</strong> changes to the same lines of code.<br />

• 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

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

Saved successfully!

Ooh no, something went wrong!