如何在 Visual Studio TFS 中回滚?
我正在开发一个使用 VSTS 2008 的大型项目的一个子模块。
我需要将该模块回滚到早期版本(之前大约有 4 次签入)。我尝试在 Visual Studio UI 中执行此操作,最终意识到没有回滚选项。
经过一番研究,我确定有一个强大的工具下载,声称支持通过命令行进行回滚工具。然而,似乎几乎没有相关的文档。
谁能一步一步描述如何在 VS2008 中回滚到以前的版本? (使用电动工具或其他方式)。
额外问题——有人知道我们是否可以在 VS2010 中获得更强大的回滚支持吗?
I'm working on one sub-module of a large project for which is use VSTS 2008.
I have a need to rollback the module to an earlier version (about 4 check-ins previous). I tried to do this in the Visual Studio UI, and finally realized there is no option to rollback.
After some research, I determined there is a power tools download that purports to support rollback via a command-line tool. However, there appears to be virtually no documentation for it.
Can anyone describe step by step how to rollback to a previous version in VS2008? (Using Power Tools or otherwise).
Bonus question--anyone know if we might get more robust rollback support in VS2010?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
右键单击源代码管理资源管理器中的文件夹。选择获取特定版本。选择您想要获取的版本(按变更集、日期、标签等)。
编辑:此时您的本地版本将是您想要的版本。签出更改的文件,然后将它们重新签入。这将打开合并向导,它可能会抱怨服务器的版本比您的版本更新。通过向导并按照您想要的方式合并文件(其中一个选项是放弃服务器更改,这听起来就是您想要的)。在此过程结束时,它可能会告诉您由于合并过程(或类似性质的过程)没有签入任何文件,只需单击“确定”,然后再次签入。这应该可以完成你所需要的。
Right-click on the folder in Source Control Explorer. Choose Get Specific Version. Choose the version that you want to get (by changeset, date, label, etc).
EDIT: At this point your local version will be the version that you want. Check out the changed files and then check them back in. This will bring up the merge wizard and it will probably be complaining about how the server has a newer version than you do. Go through the wizard and merge the files the way you want them (one of the options is to discard the server changes, which is what it sounds like you want). At the end of this process, it may tell you that no files were checked in due to the merge process (or something of that nature), just hit OK and then check in again. This should accomplish what you need.
幸运的是,这在 TFS 2012 中变得更加容易。现在 GUI 中有一个回滚选项。
MSDN 提供了有关如何执行此操作以及哪些选项的详细信息可用。
以下是来自 MSDN 的有关如何回滚到特定版本的文本:
当然,您也可以回滚整个变更集或变更集的集合。如果您愿意,您还可以轻松回滚到特定时间点。
This has luckily been made much easier in TFS 2012. Now there is a Rollback option from the GUI.
MSDN has more information on how to do it, and what options are available.
Here is the text from MSDN on how to rollback to a specific version:
You can of course also rollback entire changesets or a collection of changesets. And you can also easily rollback to a specific point in time if you wish.
有一种方法,但我觉得不太好..打开 Visual Studio 命令提示符并..
There IS a way but I don't find it pretty.. Open Visual Studio command prompt and ..
2011 年 8 月 TFS Power Tools 在 Visual Studio 2010 UI 中添加了完整的回滚支持。
下载链接:http://visualstudiogallery.msdn.microsoft.com/c255a1e4- 04ba-4f68-8f4e-cd473d6b971f
TFS 2012 中也包含此函数。
The August 2011 TFS Power Tools added full rollback support right into the Visual Studio 2010 UI.
Download link: http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
This function is also included with TFS 2012.
是的。与直接针对现有 2008 客户端 API 进行编码的 Power Tools 不同,TFS 2010 具有用于直接在服务器上执行回滚的新 API。这使得它们更快、更可靠,同时添加了 2008 年根本无法实现的功能,例如恢复合并历史记录。
Yes. Unlike the Power Tools, which is coded directly against the existing 2008 client API, TFS 2010 has a new API for executing rollbacks directly on the server. This makes them far faster and more reliable, while adding functionality that wasn't possible at all in 2008 such as reverting merge history.
来自 MSDN 文章如何:回滚更改集( VS2008虽然也有其他版本)
From the MSDN article How to: Roll Back a Changeset (VS2008 although other versions are available)
在 Visual Studio 2013 中,这变得更加容易。要回滚,请执行以下操作:
In Visual Studio 2013 this became an easier task. To Rollback, do the following: