TFS 冲突类型:可写文件 - 本地存在同名的可写文件 [英] TFS Conflict Type: Writable File - A writable file by same name exists locally

查看:44
本文介绍了TFS 冲突类型:可写文件 - 本地存在同名的可写文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取我的项目的最新信息.当我这样做时,TFS 会告诉我该项目中的每个文件都有冲突.每个文件都有相同的冲突:冲突类型:可写文件 - 本地存在同名的可写文件.

I'm trying to get latest of my project. When I do, TFS shows me that I have conflicts on every single file in that project. Every file has the same conflict: Conflict Type: Writable File - A writable file by same name exists locally.

它给我的解决方案是覆盖本地文件或文件夹",但我必须一一执行.

The resolution it gives me is "Overwrite Local File or Folder" but I have to do this one by one.

为什么TFS会认为我有冲突(我没有更改任何文件)?

Why does TFS thinks that I have conflicts (I haven't changed any files)?

推荐答案

Grant 的回答非常适合解决多个冲突.

Grant's answer is great for how to resolve multiple conflicts.

至于为什么您这些冲突,一般来说,您的TFS客户端检测到本地存在一个不受TFS管理的文件,但是您正在尝试执行会覆盖的get操作那个文件.

As for why you have those conflicts, generally speaking, your TFS client has detected that a file exists locally that is not managed by TFS, but you are trying to perform a get operation that would overwrite that file.

如果您遵循正常的开发工作流程(而不是在编辑器之外编辑文件),最常见的可写冲突来源来自搁置集.如果您要挂起对文件的添加,那么您要撤消该添加(显式或因为您搁置更改并取消选择保留挂起更改按钮),该文件不会被删除.(这是为了防止数据丢失 - 您想要创建文件但将其签入源代码管理的情况并不少见.)

If you're following a normal development workflow (and not going and editing files outside of your editor), the most common source of writable conflicts is from shelvesets. If you were to pend an add on a file, then you were to undo that add (either explicitly or because you shelved the change and deselected the preserve pending changes button), the file is not deleted. (This is to prevent data loss - it's not uncommon that you would want to create a file but not have it checked in to source control.)

现在,如果您(或其他人)要签入该搁置集(通过从该搁置集创建构建,或通过门控签入,或者因为您的代码审查员直接签入您的搁置集),那么当您这样做时获取最新版本,您的 TFS 客户端将检测到该文件在本地仍然存在,因此您会遇到可写冲突.

Now if you (or someone else) were to check in that shelveset (either through creating a build from that shelveset, or from gated check-in, or because your code reviewer checked in your shelveset directly), then when you do a get latest, your TFS client will detect that the file still exists locally and thus, you'll have a writable conflict.

这在门控登记的情况下可能不是特别明显.门控签入的实际工作原理是,当您尝试签入更改时,签入实际上转换为搁置集.然后,TFS 构建代理将尝试构建您的搁置集,如果构建成功,它将代表您签入该搁置集.如果构建失败,搁置集会保留,您可以取消搁置以修复构建错误.

This may not be particularly obvious in the case of gated check-in. How gated check-in actually works is when you try to check in your changes, your check-in is actually converted to a shelveset. The TFS build agent will then try to build your shelveset, and if the build succeeds, it will then check-in that shelveset on your behalf. If the build fails, the shelveset remains and you can unshelve to fix the build errors.

因此,在使用门控签入时运行构建通知应用程序很重要,这将允许您在提交更改后协调"更改.协调您的签入只会获取由构建服务器提交的签入,但它会避免冲突,因为它了解本地磁盘上更改的上下文.(它会将您本地磁盘上的内容与服务器上的内容进行比较.)如果您不选择协调,很遗憾,您将在添加的文件上发生可写冲突.

For this reason, it's important to run the build notification application when you're using gated check-in, which will allow you to "reconcile" your changes once they're submitted. Reconciling your check-in will simply do a get of the check-in that was submitted by the build server, but it will avoid conflicts since it understands the context of the changes that are on your local disk. (It will compare the contents on your local disk to the contents on the server.) If you do not choose to reconcile, you will, unfortunately, have writable conflicts on files that were added.

(请注意,这种情况 不会在下一版本的 TFS 中产生冲突 - 如果没有内容差异,TFS 不会产生冲突.)

(Note that this scenario will not produce a conflict in the next version of TFS - if there are no content differences, TFS will not produce a conflict.)

这篇关于TFS 冲突类型:可写文件 - 本地存在同名的可写文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆