如何使用egit删除提交? [英] How to delete commits with egit?

查看:140
本文介绍了如何使用egit删除提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚提交了一些我想删除的egit的错误提交。

I just made some bad commits with egit that I would like to delete.

如何从egit中删除提交?

How do I delete commits from egit?

谢谢!

编辑:我尝试了几次硬复位,但没有做任何事情。

I tried a hard reset a few times but it didn't do anything.

编辑2 :硬复位确实有回滚的变化,但是我希望它们从历史上完全消失,就好像我从未做过这些提交一样。

EDIT 2: Hard reset does rollback changes indeed, but I want them to completely disappear from the history as if I never made these commits.

推荐答案

历史记录。
您应该在最后一次提取之前选择最后一个提交,大部分时间是在当前HEAD下的第二个提交。
该提交的RightMouse和重置 - >硬(将重置所有提交和本地工作区更改为所选提交)。

RightMouse on your Repository and click on "show in -> history". You should select the last commit before your last "fetch"...most of the time its the second commit under your current HEAD. RightMouse on that commit and "reset -> Hard" (will reset all your commits AND local workspace changes to the selected commit).

您应该看到向上箭头更改为向下箭头,这意味着您的提交被删除,并且您的存储库已过时。使用fetch& rebase是最新的。

you should see the up-arrow changing into an down-arrow, meaning that your commits are deleted and that your repository is outdated. Use "fetch" & "rebase" to be up to date.

这篇关于如何使用egit删除提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆