如何在 TFS 2010 中恢复(回滚)签入

发布于 2024-08-29 13:14:18 字数 35 浏览 2 评论 0 原文

谁能告诉我如何在 TFS 2010 中恢复(回滚)签入?

Can anyone tell me how to revert (roll back) a checkin in TFS 2010?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

蓝礼 2024-09-05 13:14:18

Team Foundation Server 2010 版本控制中,您有两个选项可用于回滚(恢复)变更集。第一个选项是使用用户界面(如果您有最新版本的 TFS安装了 2010 年电动工具)。

Rollback Changeset in UI for TFS 2010

另一个选项是使用 TFS 2010 版本控制命令行应用程序

tf.exe rollback

我有有关这两种方法的信息在我的 博客文章

对于 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).

Rollback Changeset in UI for TFS 2010

The other option is using the TFS 2010 version control command-line application:

tf.exe rollback

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

别想她 2024-09-05 13:14:18

对于 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.

寄与心 2024-09-05 13:14:18

不使用电动工具或命令行:

  1. 确保工具 -> 选项 -> 源代码管理 -> Visual Studio Team Foundation Server 取消选中 签出时获取项目的最新版本
  2. 在源代码管理资源管理器中查看项目文件夹的历史记录,然后右键单击要回滚到的变更集并选择“获取此版本”
  3. 在源代码管理资源管理器中的项目文件夹上签出以进行编辑(这应该保留您刚刚从历史记录中获取的本地版本)
  4. 在源代码管理中的项目文件夹上签入挂起的更改 更改
  5. 如果 Visual Studio 要求您解决冲突,请选择“保留本地”并再次尝试签入源代码管理资源管理器中项目文件夹上的挂起

Without using power tools or command line:

  1. ensure Tools->Options->Source Control->Visual Studio Team Foundation Server UNCHECK Get latest version of item on check out
  2. View the history of project folder in Source Control Explorer and right click on the changeset to roll back to and choose Get This Version
  3. Check out for edit on the project folder in the Source Control Explorer (this should keep your local version you just got from the history)
  4. Check in pending changes on the project folder in the Source Control Explorer
  5. if visual studio asks you to resolve conflicts, choose keep local and attempt check in of pending changes on the project folder in Source Control Explorer again
淡淡绿茶香 2024-09-05 13:14:18

回滚其他用户的更改

如果您尝试回滚其他用户的更改,请确保您了解尝试回滚的文件的最新信息;否则你会看到错误:

“没有要回滚的更改。”

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:

"No changes to roll back."

昔日梦未散 2024-09-05 13:14:18

您可以通过命令行回滚变更集(在 TFS2010 中):

  1. 打开 CMD 或 Visual Studio 命令提示符
  2. 将目录更改为工作区文件夹。示例:cd C:\myWorkspace
  3. 运行以下 tf 命令(其中 123 是变更集编号)
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
  4. 转到 Pending Changes 窗口检查标记有 edit 的文件,回滚并签入。
    待处理更改回滚操作后的示例

注意:即使在 Visual Studio 命令提示符中,也必须使用 tf.exe 完整路径,以避免“无法确定工作区”错误。更多信息 此处

回滚参考 (TFS 2010)
https://msdn.microsoft.com/en -us/library/dd380776(v=vs.100).aspx

You can rollback a changeset (in TFS2010) through command line doing:

  1. Open CMD or Visual Studio Command Prompt
  2. Change directory to your workspace folder. Example: cd C:\myWorkspace
  3. Run following tf command (where 123 is changeset number)
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" rollback /changeset:123 /recursive
  4. Go to Pending Changes window to check files marked with edit,rollback and do a Check In.
    pending changes example after a rollback operation

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

Rollback reference (TFS 2010)
https://msdn.microsoft.com/en-us/library/dd380776(v=vs.100).aspx

忆伤 2024-09-05 13:14:18

在 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.

じ违心 2024-09-05 13:14:18

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文