- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我看过这篇文章: http://jenkins-ci.org/content/summary-report-git-repository-disruption-incident-nov-10th
它描述了一个事件,其中用户意外地从存储库的过时状态触发了 git push --force
。
当然,这需要进行一些清理以恢复原始状态分支。但由于 Git 从不删除信息,据我所知,此清理过程始终是可能的。
因此,即使您 rebase 、push --force(以及其他可能重写历史的操作)原始提交仍然存在,只是需要找到它们,对吧?
简而言之,git中真正删除数据的任何(破坏性)操作是什么?
最佳答案
无法通过任何引用访问的提交最终将被删除,其中包括引用日志。发生这种情况的默认时间段非常保守。您可以使用多种选项通过 git config 进行调整。请参阅下面的一些特定选项。
很多人(包括我自己)会建议您设置接收 Hook 以拒绝非快进 merge ,这在很大程度上会使这个问题变得毫无实际意义(在服务器上,个人仍然可能会丢失未推送的本地工作)。
gc.auto
When there are approximately more than this many loose objects in the repository, git gc --auto will pack them. Some Porcelain commands use this command to perform a light-weight garbage collection from time to time. The default value is 6700. Setting this to 0 disables it.
gc.pruneexpire
When git gc is run, it will call prune --expire 2.weeks.ago. Override the grace period with this config variable. The value "now" may be used to disable this grace period and always prune unreachable objects immediately.
gc.reflogexpire
gc.<pattern>.reflogexpire
git reflog expire removes reflog entries older than this time; defaults to 90 days. With "<pattern>" (e.g. "refs/stash") in the middle the setting applies only to the refs that match the <pattern>.
gc.reflogexpireunreachable
gc.<ref>.reflogexpireunreachable
git reflog expire removes reflog entries older than this time and are not reachable from the current tip; defaults to 30 days. With "<pattern>" (e.g. "refs/stash") in the middle, the setting applies only to the refs that match the <pattern>.
关于git - Git 从不删除任何信息吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26448898/
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 6 年前。 Improve t
notificationCenterPublisher = NotificationCenter.default .publisher(for: .NSManagedObjec
我有以下 Rust 代码: #[inline(never)] fn x() -> i32 { 21 } pub fn main() -> i32 { x() } 如果没有优化 (-C
notificationCenterPublisher = NotificationCenter.default .publisher(for: .NSManagedObjec
我有以下 Rust 代码: #[inline(never)] fn x() -> i32 { 21 } pub fn main() -> i32 { x() } 如果没有优化 (-C
假设我的 ASPX 页面没有内联 C# 代码块。 所以,我可以安全地设置 ...在我的 web.config 文件中,不用担心编译错误。 就性能而言,使用以下设置是否会有任何损失? 即“自动”检测
应用程序.js var win1 = Titanium.UI.createWindow({ title:'Tab 1', backgroundColor: 'black', l
基本上,我正在为实现多级优先级队列的 xv6 内核实现一个调度程序。我有一个严重的问题,我不明白,我类(class)的助教不明白,我已经错过了这个项目的最后期限,所以现在帮助我不会给我任何加分 - 但
我想避免 git 自动 merge 我的 composer.json。这样我就可以在 develop 分支中有一个使用 dev-develop 包的 composer.json,而 master 中的
当比较两种不同的算法实现时(因此,不关心它们的绝对性能,而只关心相对性能)我是否最好强制 Java 只运行解释代码? 也就是说,打开 -Xint 标志会更好吗? 最佳答案 我不认为禁用 JIT 会更好
class A{ const size_t number; public: A(size_t number): number(number) {} void f(){
问题 寻找在以下之间切换的方法: 总是 从不 仅在静默模式下 仅当不处于静默模式时 这些选项在手机上的路径---菜单>>设置>>声音>>振动---找到。 通过手机导航很容易更改(顺便说一句,我的手机是
如何设置电源设置关闭:从不(关闭显示器=从不,让计算机进入休眠状态=从不),通过c#代码 最佳答案 这个问题中给出的链接可以告诉你一个方法。 Programmatically change Windo
我是一名优秀的程序员,十分优秀!