删除引用问题的已删除提交 [英] remove deleted commit that references an issue

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

问题描述

我修改了一次提交并且每次都执行 push --force (愚蠢的错误;直到准备好发送我的编辑器的PR,我才意识到)已经通过修复标签和尾随空白而产生了大量的噪音)。我认为不再存在的提交在GitHub上仍然可用,并且问题引用会导致出现这些不存在的提交的链接列表:



我摆脱了这些在GitHub远程提交,以便这些额外的链接将消失?

解决方案

一般来说,你不能从Github中删除一个提交。



正如在其他问题的答案中指出的那样,您可以引用新的提交(这是你已经完成的)。



在你的克隆中运行 git gc 也无济于事,因为这与Github上的回购无关。



Github每隔一段时间运行它们自己的 gc 时间表和/或触发事件不公开)。 GC虽然可以通过该问题的引用来阻止该提交,但即使该提交获得GC也可能引用此引用(然后404')。



通常情况下,您会忽略这种事情。



如果这是一个真正的问题(例如敏感数据可访问),您可以联系Github支持,并要求他们删除引用并提交。


I amended a commit a few times and did push --force each time (stupid mistake; I didn't realize until getting ready to send a PR that my editor had generated tons of noise by fixing tabs and trailing whitespace). The commits that I thought were no longer existent are still reachable on GitHub, and the issue reference causes a list of links to these non-existent commits to appear:

How do I get rid of these commits on the GitHub remote so that these extra links will go away?

解决方案

In general, you cannot remove a commit from Github yourself.

As pointed out in the answers to the other question linked as a possible duplicate, you can only reference new commits (which is what you've already done).

Running git gc in your clone will not help either, as this has nothing to do with the repo on Github.

Github run their own gc every now and then (the schedule and/or triggering events are not made public). GC'ing that commit might be prevented by that reference in the issue though, or the reference might persist (then 404'ing) even if the commit gets GC'd.

Usually, you would just ignore this kind of thing.

If it is a real problem though (e.g. sensitive data being accessible), you can contact Github Support and ask them to remove the reference and commit.

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

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