tfs - 为什么TFS中存在文件名冲突

标签 tfs

我有一个场景,我有一个 master 分支和一个从 master 分支获取的开发分支。 master 分支包含一些旧版本的一些 dll:s,我已经在我的 dev 分支中更新了它们。现在,当我尝试将我的更改从我的 dev 分支合并回 master 分支时,我遇到了“Filname Collision”冲突。当然文件名会冲突,我已经更新了文件并想使用我的新版本。但出于某种原因,我没有将本地作为解决问题的方法。我所能做的就是获取服务器、重命名服务器或重命名本地。这是为什么?

最佳答案

问题是您替换了 DLL 而不是“更改”它,因此合并识别它是文件系统中的一个完全独立的条目并提示。

解释得更全面herehere ,包括一个决议:

We cannot resolve this through the GUI so we will drop to the command line and resolve the conflict appropriately. Within resolve we have the ability to specify a new name for the target file- you can find all the options here. The option we will use is AcceptYoursRenameTheirs and in a namespace conflict it accepts the contents and name of your file (source) and renames their (target) file to a new name that is specified.

To accomplish this we will also need to use the /newname option. Here is the command you should execute:

tf resolve a.txt  /auto:AcceptYoursRenameTheirs  /newname:a-old.txt

After this command succeeds you will get two pending changes: 1) a merge, branch for the new a.txt into the target folder and 2) a rename of a.txt to a-old.txt in target. So after checking in these changes the merge relationship will look like: source/a.txt à target/a.txt just as you wanted it.

If instead, you would like the opposite to take place, meaning you need source/a.txt to map to a new name in the target folder then the command to execute would be:

tf resolve a.txt  /auto:AcceptMerge /newname:a-newname.txt

Consequently that would give you a merge relationship of source/a.txt -à target/a-newname.txt

With the conflict resolved the developer is now free to check in the changes brought by this merge.

关于tfs - 为什么TFS中存在文件名冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7500253/

相关文章:

c# - 通过数据仓库以编程方式检索 TFS "instrumented binaries"的路径信息

TFS "Copy"从一个字段到另一个字段的值

.net - Team Foundation Server 生成变量

tfs - 在 TFS 中,如何提取过去特定日期之间分配给我的所有项目?

c# - 如何以编程方式通过代理连接到 TFS?

visual-studio-2008 - 这些文件的字符编码在 TFS 中不同

tfs - TFS 中的自定义 checkin 策略?

rest - 如何从 VSTS 下载所有附件?

TFS 工作项 AssignedTo 字段在转换时设置为服务帐户而不是当前用户

visual-studio - 在 System.History 中提及用户