[英]See what git fetch displayed last time
在我获取远程数据( git-fetch
)之后,git 足够友好地告诉我每个分支上的 SHA, old..new
,但是如果我在控制台中工作很多,我可能会丢失它们。
如何再次显示它们?
当然,我可以将 output 保存到文件中或记住它。 这些对我来说是没有选择的。
编辑
从评论:
要获取所有远程分支上刚刚更改的内容,请执行
git for-each-ref refs/remotes |
while read ref type name
do
echo ----- $name
git log --oneline "$name@{1}..$name@{0}"
done
典型 output:
----- refs/remotes/sehe.nl/stable
warning: Log for 'refs/remotes/sehe.nl/stable' only has 1 entries.
----- refs/remotes/sehe.nl/testing
4934e92 reviewed INSTALL file as per #1331
----- refs/remotes/sehe.nl/unstable
----- refs/remotes/sehe.nl/xattrs
warning: Log for 'refs/remotes/sehe.nl/xattrs' only has 1 entries.
----- refs/remotes/tobey/maint
6215be7 reviewed INSTALL file as per #1331
----- refs/remotes/tobey/maint-0.6.9
warning: Log for 'refs/remotes/tobey/maint-0.6.9' only has 1 entries.
----- refs/remotes/tobey/master
warning: Log for 'refs/remotes/tobey/master' only has 1 entries.
----- refs/remotes/tobey/testing
4934e92 reviewed INSTALL file as per #1331
请注意, unstable
只是在 @{1}..@{0} 之间没有可访问的提交,带有警告的分支在日志中没有先前的 ref 值。
奖金
我也更喜欢调整日志:
git log --oneline --graph --left-right --cherry-pick \ "$name@{1}...$name@{0}"
(注意...(!)中的额外点)
这将显示合并方向,并显示非线性提交差异; 即它可以很好地显示可能被强制推(或拉)的参考差异
要获取所有分支的 reflog 信息,只需
git log -g --oneline --branches
你会得到 output 类似于:
4934e92 testing@{0}: commit: reviewed INSTALL file as per #1331
6215be7 maint@{0}: commit: reviewed INSTALL file as per #1331
1e5e121 emmanuel@{0}: rebase finished: refs/heads/emmanuel onto f6e2c6c3f9cec0ccf7d96d3edb92f806587adcbc
7b326b9 emmanuel@{1}: branch: Created from rainemu/master e96783e compress@{0}: rainemu/compress: updating HEAD
ff19004 compress@{1}: rebase finished: refs/heads/compress onto f6e2c6c3f9cec0ccf7d96d3edb92f806587adcbc
f6e2c6c unstable@{0}: rebase -i (abort): updating HEAD
6b8f506 unstable@{1}: commit (merge): Merge remote branch 'rainemu/master' into unstable 5327c2f unstable@{2}: merge rainemu/master: Merge made by recursive.
f6e2c6c unstable@{3}: merge emmanuel: Fast-forward
f45ff54 unstable@{4}: merge rainemu/master: Merge made by recursive.
e23fc0b maint@{1}: commit: fix scons warnings dd52720 master-lucid@{0}: commit: lucid 1fb30cf testing@{1}: commit: fix missing split on environment CFLAG
aac7936 unstable@{5}: pull rainemu master: Merge made by recursive.
2c01d7f unstable@{6}: branch: Created from sehe.nl/unstable 927ad7a testing@{2}: branch: Created from sehe.nl/testing
3b32fa7 maint@{2}: branch: Created from sehe.nl/maint 6eaa64f maint-0.6.9@{0}: branch: Created from sehe.nl/maint-0.6.9
git reflog show origin/master
似乎有效; 为我猜的每个分支运行它。 我认为没有一个 reflog 命令可以为所有分支提取数据
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.