简体   繁体   English

无限期地保留 Git Reflog?

[英]Keep Git Reflog Indefinitely?

I tend to be a bit paranoid about my data, including the ability to recover it.我倾向于对我的数据有点偏执,包括恢复它的能力。

Git reflog data is pruned after 30 days. Git reflog 数据在 30 天后被修剪。 Is there a way of setting it so that the reflog data is maintained and kept indefinitely?有没有办法设置它以便维护和无限期保留引用日志数据?

Any major advantage or disadvantage (other than space or speed considerations) to doing so?这样做有什么主要优点或缺点(除了空间或速度方面的考虑)?

Caveat: reflogs are local and are not sent/received with push/pull operations.警告:引用日志是本地的,不会通过推/拉操作发送/接收。

Cons: reflogs may result in (otherwise) unreachable snapshots (and consequently blobs) being kept around, growing your repo to larger sizes than might be desirable.缺点:reflogs 可能会导致(否则)无法访问的快照(以及因此的 blob)被保留,使您的存储库增长到可能超出预期的大小。 Look at gc.reflogexpireunreachable for something that may help in this respect.查看gc.reflogexpireunreachable以了解可能在这方面有所帮助的内容。

Two configuration settings govern the expiration of reflog entries:两个配置设置管理 reflog 条目的过期时间:

gc.reflogexpire , gc.<pattern>.reflogexpire gc.reflogexpire , gc.<pattern>.reflogexpire

git reflog expire removes reflog entries older than this time; git reflog expire 删除早于这个时间的 reflog 条目; defaults to 90 days.默认为 90 天。 With "<pattern>" (eg "refs/stash") in the middle the setting applies only to the refs that match the .使用“<pattern>”(例如“refs/stash”)在中间,该设置仅适用于匹配 .

gc.reflogexpireunreachable , gc.<ref>.reflogexpireunreachable gc.reflogexpireunreachable , gc.<ref>.reflogexpireunreachable

git reflog expire removes reflog entries older than this time and are not reachable from the current tip; git reflog expire 删除早于这个时间并且无法从当前提示访问的 reflog 条目; defaults to 30 days.默认为 30 天。 With "<pattern>" (eg "refs/stash") in the middle, the setting applies only to the refs that match the <pattern>.中间有“<pattern>”(例如“refs/stash”)时,该设置仅适用于与<pattern> 匹配的引用。

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

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