且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在现有裸仓库中创建reflogs信息

更新时间:2023-02-14 21:40:35

一个相对简单的文件格式。下面是一个例子:

The reflog is a relatively simple file format. Here's an example:

] cat .git/logs/HEAD|sed 's/\t/<TAB>/'
0000000000000000000000000000000000000000 5cfe4256d98af22a570c78c5e3048391a90f5f98 Joe User <foo@example.com> 1306427954 -0400<TAB>clone: from git://git.kernel.org/pub/scm/git/git.git

您可以按照相同的格式手动构建适当的reflog:

You can manually construct appropriate reflogs by following the same format:

previous-ref-or-zero new-ref User Name <user@email> unix-timestamp timezone\tmessage

只需为每个参考创建一个。你可以直接用 git for-each-ref 和适当的格式字符串来做到这一点(谢谢,Chris!)

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!)