简体   繁体   English

'TortoiseSVN --> 显示日志 --> 恢复到此版本'的 TortoiseGit 等效项

[英]TortoiseGit equivalence for 'TortoiseSVN --> Show log --> Revert to this revision'

I am looking for a TortoiseGit operation which is equivalent to:我正在寻找一个 TortoiseGit 操作,它相当于:

TortoiseSVN --> Show log --> Revert to this revision

In TortoiseSVN, this operation reverts the local repository to the revision selected, while keeping all changed files checked out.在 TortoiseSVN 中,此操作将本地存储库恢复为选定的修订版,同时保持所有更改的文件被签出。

In other words, the changed files show up when I do TortoiseSVN --> Check for modifications , and I can easily discard those changes when I finish testing the revision that I have reverted to.换句话说,当我执行TortoiseSVN --> Check for modifications时,更改的文件会显示出来,当我完成对已恢复到的修订版的测试时,我可以轻松地丢弃这些更改。

For some reason, I am finding it very difficult to perform this useful operation on TortoiseGit.出于某种原因,我发现在 TortoiseGit 上执行这个有用的操作非常困难。

The workaround that I am currently using is:我目前使用的解决方法是:

  1. Perform TortoiseGit --> Show log --> Export this revision...执行TortoiseGit --> Show log --> Export this revision...
  2. Copy the output files onto my local repository将输出文件复制到我的本地存储库

Is there a more straightforward manner for this?有没有更直接的方式呢?

I've tried the following TortoiseGit operations, but they just "cause havoc" on my local repository, and I am unable to proceed with the "standard" Commit & Push procedure afterwards:我已经尝试了以下 TortoiseGit 操作,但它们只是对我的本地存储库“造成严重破坏”,之后我无法继续执行“标准”提交和推送程序:

  • Reset "master" to this...
  • Switch/Checkout to this...
  • Rebase "master" onto this...
  • Revert change by this commit

I found a similar question here , but the answers suggest options that are not even viable in my TortoiseGit popup menu.我在这里找到了一个类似的问题,但答案建议在我的 TortoiseGit 弹出菜单中甚至不可行的选项。

  1. Right click on the commit, then Compare with working tree右键单击提交,然后Compare with working tree
    在此处输入图像描述
  2. Select all files expect Added ones and Rename ones, and Right click, and Revert to revert xxxxxxx(sha1)选择所有文件, Added的文件和Rename的文件,然后右键单击,然后Revert to revert xxxxxxx(sha1)
    在此处输入图像描述
  3. For Added ones, you need to deleted them manually对于已Added的,您需要手动删除它们
  4. For Renamed ones, you need to rename them back manually对于Renamed的,您需要手动重命名它们
  5. Back to the Changed Files and refresh it to see if it is No differences found!返回Changed Files并刷新它以查看它是否未No differences found!
    在此处输入图像描述
  6. Commit犯罪
    在此处输入图像描述
  7. The log日志在此处输入图像描述

I found another batter way than I answered before, and you don't care about Renamed and added itme(s) in this way :我发现了另一种击球手方式,而不是我之前回答的方式,而且您不关心Renamed并以这种方式added itme

  1. Select all commits you want to revert, and right click on them, and click Revert changes by these commits选择您要还原的所有提交,然后右键单击它们,然后单击Revert changes by these commits

    在此处输入图像描述

  2. Will be a progress dialog将是一个进度对话框

    在此处输入图像描述

  3. Then, ask you if perform the Commit.然后,询问您是否执行 Commit。 Click Commit单击Commit

    在此处输入图像描述

  4. The commit dialog:提交对话框:

    在此处输入图像描述
    But, as you can see, TortoiseGit gives out one sha1 value, instead of all commit sha1 values you want to revert.但是,如您所见,TortoiseGit 给出了一个 sha1 值,而不是您想要恢复的所有提交 sha1 值。 So you may be want to add/modify more information there.所以你可能想在那里添加/修改更多信息。 Like this:像这样:
    在此处输入图像描述

  5. The log of that revert commit还原提交的日志

    在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM