[转]Resolve Team Foundation Version Control conflicts

本文转自:http://msdn.microsoft.com/en-us/library/ms181432.aspx

An advantage of using Team Foundation version control to manage your files is that several people can work concurrently on a file. One drawback is that sometimes you must resolve conflicts before you can get, check in, unshelve, merge, or roll back your files.

Although it can be frustrating to encounter conflicts, the system provides information and tools to help you understand and resolve conflicts.

Resolve conflicts


Use the Resolve Conflicts window to resolve conflicts that are blocking you.

By default, the window shows only the conflicts caused by the most recent operation you attempted. When the window is in this state, a message appears that begins: Path filter applied. To show all conflicts in your workspace, choose Get All Conflicts.  A message that begins with: n Conflict(s) appears.

If a lot of time has passed since you made changes to files in your workspace, new conflicts might have occurred. To refresh the Resolve Conflicts window, choose Refresh.

Each conflict contains information and sometimes links that might help you resolve it. To get more information, you can select the conflict and choose:

  • History to see the history of the file. If the operation that caused the conflict is a Merge or a Rollback, then you can choose the menu control to the right of History and then select either Source History or Target History.

    See Get the history of an item.

  • Annotate to view details on all changes that were made to the most recent version of the file, including who made each change and when they made it. See View file changes using annotate.
  • Compare (or the menu to the right of the button and then choose a command). The Diff window appears.

AutoResolve all conflicts


By default the system automatically attempts to AutoResolve All conflicts unless you have turned off this option (see Tips). In the Resolve Conflicts window, you can also manually choose AutoResolve All, and then choose:

  • Select All Conflict Types if you want the system to attempt to resolve the conflicts automatically by using all its heuristics.
  • Select Specific Conflict Types if you want the system to attempt to resolve the conflicts, but you want to exclude some heuristics.

    The Choose Conflicts to Resolve dialog box appears. Check or clear the options that you want to enable or disable, and then choose AutoResolve. For more information, see Understand the automatic options below.

The system attempts to automatically resolve the conflicts displayed in the Pending Changes window. Any conflicts the system was unable to resolve will remain in the window. You have to manually resolve these conflicts.

AutoMerge a single conflict


Choose AutoMerge if you want to try to resolve selected conflicts using all the AutoMerge options described in Understand the automatic options below.

                     Tip                  

You can press and hold either the Ctrl or the Shift key and then select multiple conflicts.

                     Note                  

If AutoMerge is disabled, then this conflict must be manually resolved.

Manually resolve a single conflict


If the system cannot automatically resolve a conflict, or if you want to make sure you understand what is changing, you must manually resolve the conflict. Within each conflict, the system displays the actions that you can take to resolve the conflict. The actions displayed depend upon the conflict type, and the operation that caused the conflict.

Merge changes in merge tool


When a conflict is caused by conflicting content changes, you can choose Merge Changes in Merge Tool.

When you choose this action, the Merge window appears.

The outcome of your work to resolve the conflict is shown in the Results pane.

In this window you can:

  • Select the layout of the window: Vertical View, Horizontal View, Mixed View.
  • Navigate among the differences and the conflicts.
  • Select items from the left and right versions of the file to include them in the result.
  • Type additional content into the file in the Result pane.
  • View the History of the file. See Get the history of an item.
  • Compare the various versions of the file.
  • Annotate the file to see who changed what. See View file changes using annotate.

When are satisfied with the contents of the Result pane, choose Accept Merge.

Understand the automatic options


In special cases, you may want to restrict the types of conflicts automatically resolved by the AutoResolve All option.

When you choose AutoResolve All, and then Specific Conflict Types, the Choose Conflicts to Resolve dialog box appears.


If you want the system to automatically resolve conflicts that occurred because…


As explained in this example…


Then select this check box…


Non-conflicting content changes were made in each version of a file


In the file version on the left, a zero was added at the beginning. In the file on the right, a three was added at the end:

                  

Conflicts with any content changes


Content changes were made that are unique to the workspace (during get or checkin operation) or target version (during merge or rollback operation)


four and five were added to the workspace or target version:

                  

Conflicts with content changes made only in the local workspace or target branch


Content changes were made that are unique to the server (during get or checkin operation) or source version (during merge or rollback operation)


four and five were added to the server or source version:

                  

Conflicts with content changes made only in the server version or source branch


A file on the server (during get or checkin operation) or in the source branch (during merge or rollback operation) was renamed


You checked out a file that is named launch.cs and worked on it. During that time, someone else checked in a changeset that affected the same file. That changeset did not modify the contents of the file, but it did change the name of the file to start.cs.


Conflicts caused by renaming file in the server version or source branch

  • Common content changes were made that resulted in identical content in each version
  • You changed a file, checked it in through a Gated Check-in build, and selected the Preserve my pending changes locally option

Changes to each version resulted in identical file content. The changes can be to the content in the files, as shown in the following example:

This option also resolves conflicts that are caused by all other operations (for example, rename, delete, undelete, and branch) and that result in identical files.

                             Tip                          

If you select this check box, when you proceed, the system will resolve these changes by taking (downloading) the server version onto your workspace.


Conflicts caused by identical change in the server and workspace

Work from the command prompt


Tips


  • By default the system automatically attempts to AutoResolve All conflicts. To change the option, from the menu bar choose Tools, Options, and then in the Options dialog box, navigate to Source Control, Visual Studio Team Foundation Server. Clear the Attempt to automatically resolve conflicts when they are generated checkbox.
  • Does your team need to collaborate to resolve a large number of conflicts (for example, which might occur after merge operation in a large codebase)? If so, a public workspace on a shared dev machine might help. See Create and work with workspaces.
时间: 2024-10-30 11:27:14

[转]Resolve Team Foundation Version Control conflicts的相关文章

TFS文件编码检查机制和修改(Team Foundation Server 2013)

TFS的版本控制系统会自动按照下面的标准检测代码文件的编码格式: 1. 首先,如果代码文件包含了BOM部分,则使用BOM中制定的编码格式打开文档 什么是BOM (Byte order mark)? http://en.wikipedia.org/wiki/Byte_order_mark 2. 如果代码文件没有BOM部分,TFS检测第一个千字节中的不可打印ASCII字符(unprintable ASCII character).如果第一个千字节中没有不可打印ASCII字符,则使用当前页面的编码设置

在Team Foundation Server中查找文件或代码

很多用户在使用TFS的过程中,都抱怨一个问题,不能在TFS的代码库中查找文件!虽然TFS的所有数据都存储在数据库中(SQL Server),但是由于代码文件存储的特殊性,你不能通过全文搜索的功能直接在数据库里查询.当前最新版本TFS 2013 update 4和TFS Online,也没法在界面上找到与代码有关的搜索功能. 但是通过调研,发现TFS代码库中的查询功能,有以下几中方法: 1. 利用TFS代码的命令行工具TF.exe查询代码库中文件 TFS代码的命令行工具TF.exe几乎可以完成在U

Team Foundation Server 2013 with Update 3 Install LOG

[Info   @10:14:58.155] ====================================================================[Info   @10:14:58.163] Team Foundation Server Administration Log[Info   @10:14:58.175] Version  : 12.0.30723.0[Info   @10:14:58.175] DateTime : 10/03/2014 18:1

Put Everything Under Version Control

Put Everything Under Version Control Diomidis Spinellis PUT EVERYTHiNG iN ALL YOUR PROjECTS UNDER VERSiON CONTROL. The resources you need are there: free tools like Subversion, Git, Mercurial, and CVS; plentiful disk space; cheap and powerful servers

TF255466: Team Foundation Server 的配置过程无法继续。以前的更新或安装需要重

在验证是否可以安装 SharePoint 时的提示,Error [ System Checks ] TF255466: The configuration process for Team Foundation Server cannot continue.  A previous update or installation requires a restart of the operating system.  Restart the computer, and then open the

TFS (Team Foundation Server) 2013集成Maven构建

Team Foundation Server原生就支持跨平台的构建,包括Ant和Maven两种构建方式.通过配置构建服务器,连接TFS源代码库,可以实现持续集成构建,自动检测代码库健康状况,进而实现自动测试和部署.本文以Maven为例,介绍如何在TFS 2013的基础上实现服务器构建. 1. 前提条件 -Team Foundation Server 2013 本文以Team Foundation Server 2013为例,实际上自TFS 2010开始就支持跨平台的服务器构建.在执行后面的操作前

In-Place upgrade to Team Foundation Server (TFS) 2015 from TFS 2013Team Foundation Server TFS TFS 2015 TFS upgrade TFS with Sharepoint

This upgrade document gives detailed step by step procedure for the In-Place upgrade from TFS 2013 to 2015 RTM with Reporting and SharePoint. Environment Details: TFS 2013 environment Windows server 2012 R2, TFS 2013 update 5, SQL 2014 SP1, SharePoin

初探Team Foundation Server (TFS) 2015 REST API

REST是一种简洁方便的Web服务,通过基于http协议的远程通信,可以为多种客户端程序提供远程服务,大幅提高了服务器系统的可扩展性. 微软宣布从Team Foundation Server 从2015版本开始提供REST API远程访问,其实早在2014年Team Foudation Service(VSO)就发布了REST API的接口程序.TFS通过TEST,为多种客户端和应用程序,多种设备提供了一种轻量级方式,使其可以快速与TFS服务器实现数据互访.开发人员可以在Windows, And

Team Foundation Server (TFS)与Project Server集成,使用DNS(友好地址)地址注册PWA

问题描述: 当Team Foundation Server(TFS 2010/2012/2013)与Project Server高可用性的环境集成时,必然会使用Project Server (PWA)的DNS地址注册PWA站点(RegisterPWA),而不是使用Project Server的计算机名注册,这样就会出现如下图所示的问题: 下图是执行注册PWA命令时出错的截屏 注册命令:tfsadmin project server /RegisterPWA /tfs:http://tfs2013