gpt4 book ai didi

git - 无限期地保持 Git Reflog?

转载 作者:IT王子 更新时间:2023-10-29 00:38:31 26 4
gpt4 key购买 nike

我对我的数据有点偏执,包括恢复数据的能力。

Git reflog 数据在 30 天后被删减。有没有办法设置它,以便无限期地维护和保存 reflog 数据?

这样做有什么主要优势或劣势(除了空间或速度方面的考虑)?

最佳答案

警告:reflog 是本地的,不会通过推/pull 操作发送/接收。

缺点:reflogs 可能会导致(否则)无法访问的快照(以及随后的 blob)被保留,使您的存储库增长到比预期更大的大小。看gc.reflogexpireunreachable对于可能在这方面有帮助的东西。

两个配置设置管理 reflog 条目的过期:

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 .

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 Reflog?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10422768/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com