git可以查看远程的reflog吗? [英] git can I view the reflog of a remote?
问题描述
是否可以查看远程的reflog?也就是说,我想知道 git reflog
在另一台远程机器上的输出。
Is it possible to view the reflog of a remote? That is, I want to know what the output of git reflog
is on another remote machine.
请注意,I我没有要求远程追踪分支的reflog(例如origin / master),我要求在另一台机器上 reflog
说 。
Note, I am not asking for the reflog of remote-tracking branches (such as origin/master), I am asking for what reflog
says on the other machine.
推荐答案
答案基本上是否(除了那台机器),因为reflog是本地制作的日志重新分配一些ref-name。从本质上讲,每次运行 git update-ref -m msg< name> < target>
更新记录在本地: .git / logs /< name>
添加一行:
The answer is basically "no" (except on that machine), because the reflog is a log of locally-made re-assignments of some ref-name. Essentially, every time you run git update-ref -m msg <name> <target>
the update is logged ... locally: .git/logs/<name>
gets a line appended:
$ git update-ref -m foo HEAD HEAD^
$ tail -1 .git/logs/HEAD
2418b6ba8fd0289933c9351260a272b8e410867f 8d945134b0cead535d66af29c8eb4228b5dc3763 [redacted] <[redacted]> 1334106483 -0600 foo
(消息前的内容,在这种情况下 foo
,不是空格,而是一个选项卡;为了实现目的,我扩展了它)。从概念上讲,移动分支提示的所有其他操作都会调用 git update-ref
来完成它(有些是shell脚本并从字面上做到这一点,其他的只是调用C代码,文件更新)...以及 .git / logs
中的所有内容构成引用日志。
(the thing before the message, in this case foo
, is not spaces but rather a tab; I expanded it for SO purposes). Conceptually, everything else that moves a branch tip invokes git update-ref
to do it (some are shell scripts and literally do that, others just invoke the C code that does all the file-updating) ... and everything in .git/logs
makes up the reflog.
如果有在底层的git://和/或ssh://协议中,可以让你得到reflog,这样做,但据我所知不存在。
If there were things in the underlying git:// and/or ssh:// protocols that let you get at the reflog, that would do it, but as far as I know there isn't.
这篇关于git可以查看远程的reflog吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!