如何在 TFS 2010 中恢复(回滚)签入
谁能告诉我如何在 TFS 2010 中恢复(回滚)签入?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
谁能告诉我如何在 TFS 2010 中恢复(回滚)签入?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
在 Team Foundation Server 2010 版本控制中,您有两个选项可用于回滚(恢复)变更集。第一个选项是使用用户界面(如果您有最新版本的 TFS安装了 2010 年电动工具)。
另一个选项是使用 TFS 2010 版本控制命令行应用程序:
我有有关这两种方法的信息在我的 博客文章。
对于 Team Foundation Server 2012、2013 或 Visual Studio Online,当您在团队资源管理器窗口中打开变更集的详细信息时,回滚现在直接内置到源代码管理资源管理器中。使用 Visual Studio 2012 或更高版本时,无需安装任何版本的 Power Tools 即可实现此功能。现在有一篇很棒的 MSDN 文章讨论了有关回滚更改集的详细信息:http://msdn.microsoft.com/en-us/library/ms194956(v=vs.110).aspx
You have two options for rolling back (reverting) a changeset in Team Foundation Server 2010 Version Control. First option is using the User Interface (if you have the latest version of the TFS 2010 Power Tools installed).
The other option is using the TFS 2010 version control command-line application:
I have information about both approaches on my blog post.
For Team Foundation Server 2012, 2013, or Visual Studio Online, rollback is now built-in directly to Source Control Explorer and when you are opening a changeset's details in the Team Explorer Window. You do not need to install any release of the Power Tools for this functionality when using Visual Studio 2012 or later. There is a great MSDN article discussing details about rolling back a changeset now available here: http://msdn.microsoft.com/en-us/library/ms194956(v=vs.110).aspx
对于 2010,请从命令行使用回滚命令。到目前为止,IDE 中还没有对此进行集成支持。
回滚命令
基本上,它的工作方式是创建一个“ anti-delta”来否定受影响的变更集。您可以通过执行“获取特定版本”,向文件添加一个空格,使其看起来像已更改,然后签入来手动完成相同的操作。如果我需要单个版本,我仍然会采用后一种方法来撤销更改文件,因为我发现这样做更快。
For 2010, use the rollback command from the command line. There is not integrated support in the IDE for this, as of yet.
Rollback command
Basically, the way that it works is that it creates an "anti-delta" to negate the impacted changeset. You can accomplish the same thing manually by doing a Get Specific Version, adding a space to the file so it looks like it changed, and checking it in. I still go the latter route to back out a change if I need to for a single file, as I find it quicker to do.
不使用电动工具或命令行:
Without using power tools or command line:
回滚其他用户的更改
如果您尝试回滚其他用户的更改,请确保您了解尝试回滚的文件的最新信息;否则你会看到错误:
Rolling back changes for another user
If you are attempting to rollback changes for another user, make sure you get latest on the files you are attempting to rollback; otherwise you will see the error:
您可以通过命令行回滚变更集(在 TFS2010 中):
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
注意:即使在 Visual Studio 命令提示符中,也必须使用 tf.exe 完整路径,以避免“无法确定工作区”错误。更多信息 此处
You can rollback a changeset (in TFS2010) through command line doing:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
Note: you must use tf.exe full path even in Visual Studio Command Prompt to avoid "Unable to determine the workspace" error. More info here
在 Visual Studio 和源代码管理/查看历史记录中右键单击文件
然后选择最后一个变更集,右键单击并单击“回滚”
回滚完成后,您应该再次签入。
right click file in Visual Studio and Source Control/View History
then select last changeset, right click and click Rollback
After rollback done, you should check in again.
TFS 中没有撤消选项(直到 2008 年,我还没有使用过 2010 年)。
您可以使用一些命令行强大工具来回滚更改,这些工具可能会有所帮助:
http://msdn.microsoft.com/en-us/library/ms194956%28VS.80%29.aspx
HTH
There is no undo option in TFS (up untill 2008, I haven't used 2010 yet).
There are some command line power tools you can use to rollback changes that may help:
http://msdn.microsoft.com/en-us/library/ms194956%28VS.80%29.aspx
HTH