如何在现有裸存储库中创建引用日志信息
您可能已经知道,默认情况下,git 不会为新的裸存储库启用引用日志更新。问题是,我有一个很长的历史存储库,但它是在我设置“logAllRefUpdates”标志之前创建的,现在我希望其他应用程序可以使用该信息。
如何通过对现有存储库进行最少的更改来实现这一目标。一个非常简单的解决方案是推送一个我不想的新提交(!):-)
As you might have known that by default, git doesn't enable reflog updates for new bare repositories. The problem is, I have a long history repository but it was created before I set the flag "logAllRefUpdates" on, and now I want that information for another application to work.
How can I achieve that with minimal changes made to the existing repository. A very simple solution is pushing a new commit which I don't want to (!) :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
reflog 是一种相对简单的文件格式。这是一个示例:
您可以按照相同的格式手动构建适当的引用日志:
只需为每个引用创建其中一个即可。您可以直接使用 git for-each-ref 和适当的格式字符串来执行此操作(谢谢,Chris!)
The reflog is a relatively simple file format. Here's an example:
You can manually construct appropriate reflogs by following the same format:
Just create one of these for each ref. You can probably do this directly with
git for-each-ref
with an appropriate format string (thanks, Chris!)