TFS 本地和远程不同步 - 如何“重新同步”?
我在 CodePlex 上有一个使用 TFS 的项目,并且我正在使用 Visual Studio 的 TFS 插件。 现在我复制了这个项目并在另一台没有 TFS 的 PC 上工作并做了一些重构。 愚蠢的是,我只是使用复制/粘贴和手动文本编辑来合并我的更改,期望 TFS 只接受更改。
显然,事实并非如此。 这是我的本地目录的屏幕截图: 我的本地 TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg< /a>
请注意某些文件如何缺少锁定符号 - 这些文件都丢失了。 如果您查看当前的 Codeplex 上的 TFS 树,会发现有些文件会执行以下操作:本地不再存在,即主文件夹中的 WikiPlexExtensions.cs。
有没有什么方法可以轻松地告诉 TFS 将我的本地存储库与远程存储库进行比较并获取更改? 我可以使用“从本地项目中排除”重新添加本地文件并重新添加它们,并且我可以将“已删除”文件创建为空文件只是为了删除它们,但如果我可以避免手动混乱,那就是也不错:)
I have a Project on CodePlex which is using TFS and I am using the TFS Plugin for Visual Studio. Now I have copied this project and worked on another PC without TFS and done some refactoring. Foolishly, I have then just used copy/paste and manual text editing to merge my changes, expecting that TFS just picks up the changes.
Apparantly, that is not the case.
Here is a screenshot of my local directory:
My Local TFS http://img259.imageshack.us/img259/2897/tfslocal.jpg
Notice how some files are missing the lock symbol - those are missing. If you look at the current TFS Tree on Codeplex, there are some files which do not exist locally anymore, i.e. WikiPlexExtensions.cs in the main folder.
Is there any way to easily tell TFS to compare my local to the remote repository and pick up the changes? I could re-add the local files using "Exclude from local project" and re-adding them, and I could create the "deleted" files as empty files just to delete them, but if I can avoid the manual messing around that would be good as well :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
最简单的方法是利用 VS 2008 的“在线”功能。 基本上,您希望将解决方案设置为离线,然后在连接到正确的 Codeplex 服务器时将其上线。 TFS 应该解决剩下的问题。
The easiest way is to exploit VS 2008's "online" feature. Basically you want to set your solution offline, then bring it online while connected to the proper Codeplex server. TFS should figure out the rest.
要比较本地和服务器文件夹,您可以查看 TFS 电动工具。 安装后,您可以打开源代码管理资源管理器,右键单击服务器文件夹,然后选择“比较”。 文件夹差异窗口将显示差异。 您还可以右键单击差异以查看可用命令,例如“获取最新”以更新本地文件夹。 查看关于该电动工具的 Bryan Harry 的博客文章
To compare local and server folders, you can check out TFS Power Tool. After installing it, you can bring up the source control explorer, right click on the server folder and then select 'Compare'. Folder difference window will display the differences. You can also right click on the differences to see available commands such as 'Get Latest' to update your local folder for example. Check out Bryan Harry's blog post on the power tool
我认为没有一个简单的修复方法...我过去所做的就是备份我编辑过的那些文件,然后为我编辑的文件执行“获取最新版本...”。 这应该将文件更改回只读状态等...现在,以常规方式签出文件并将您的备份粘贴到签出的文件中。 显然,这仅在您编辑了几个文件时才有效。
I don't think there is an easy fix... What I've done in the past is back up those files that I have edited, then do a "Get Latest Version..." for the files I edited. This should change the files back to being read-only etc... Now, check out the files the regular way and paste the backups you had into the checked out files. Obviously this really only works when there are a couple of files you have edited.
TFS(在 Visual Studio 中)为此提供了一个“协调”命令,请参阅Microsoft 文档,或此答案 有步骤。
顺便说一句:这个命令在最初的问题时可能不存在,但是当我搜索时这个问题首先出现。
TFS (in Visual Studio) has a "Reconcile" command for this, see Microsoft documentation, or this answer with steps.
BTW: This command may not haven been existing at time of original question, but this question came first when I was searching.