我有一个场景,我有一个 master 分支和一个从 master 分支获取的开发分支。 master 分支包含一些旧版本的一些 dll:s,我已经在我的 dev 分支中更新了它们。现在,当我尝试将我的更改从我的 dev 分支合并回 master 分支时,我遇到了“Filname Collision”冲突。当然文件名会冲突,我已经更新了文件并想使用我的新版本。但出于某种原因,我没有将本地作为解决问题的方法。我所能做的就是获取服务器、重命名服务器或重命名本地。这是为什么?
最佳答案
问题是您替换了 DLL 而不是“更改”它,因此合并识别它是文件系统中的一个完全独立的条目并提示。
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 ofa.txt
toa-old.txt
intarget
. 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/