繁体   English   中英

git reflog中的第二列是什么?

[英]What is the 2nd column in the git reflog?

我刚做了一个简单的git reflog ,这是我得到的前几行:

column1                 Column2                                Column3
2797a1d4 (HEAD -> master, upstream/master) HEAD@{0}: checkout: moving from master to master
2797a1d4 (HEAD -> master, upstream/master) HEAD@{1}: pull upstream master: Fast-forward
a461a29f HEAD@{2}: checkout: moving from master to master
a461a29f HEAD@{3}: reset: moving to HEAD
a461a29f HEAD@{4}: pull upstream master: Fast-forward
784f2cp3 (yy, alphabets, hotFix) HEAD@{5}: checkout: moving from yy to master
784f2cp3 (yy, alphabets, hotFix) HEAD@{6}: checkout: moving from master to yy
784f2cp3 (yy, alphabets, hotFix) HEAD@{7}: checkout: moving from alphabets to master

我试图了解每列代表什么。 这篇文章这个问题中读到我已经学到了:

  • Column1显然是提交,
  • Column2是我感到困惑的地方。 我理解HEAD@{0}HEAD@{7}概念。 不要得到括号内的零件! (yy, alphabets, hotFix)代表什么?
  • Column3是动作,即结帐/拉出以及消息。

另外我不确定为什么同一次提交有多行? 是因为不同的分支都指向同一个提交,它们之间没有代码更改?

reflog告诉你HEAD是如何移动的。 有三列以上。 Git文档对此很迟钝。 事实证明, git reflog只是git log一个别名,带有一些开关。

git reflog show [默认]是git log -g --abbrev-commit --pretty=oneline;的别名git log -g --abbrev-commit --pretty=oneline;

784f2cp3 (yy, alphabets, hotFix) HEAD@{7}: checkout: moving from alphabets to master
  1. 784f2cp3缩写提交。
  2. (yy, alphabets, hotFix)分支负责此提交,就像git log --decorate
  3. HEAD@{7}此提交相对于HEAD的位置,由-g添加。
  4. checkout运行了什么命令。
  5. moving from alphabets to master人类可读的描述。

(4和5在技术上是相同的列。)

这说你在分支alphabets运行git checkout master

另外我不确定为什么同一次提交有多行? 是因为不同的分支都指向同一个提交,它们之间没有代码更改?

对,就是这样。

784f2cp3 (yy, alphabets, hotFix) HEAD@{5}: checkout: moving from yy to master
784f2cp3 (yy, alphabets, hotFix) HEAD@{6}: checkout: moving from master to yy
784f2cp3 (yy, alphabets, hotFix) HEAD@{7}: checkout: moving from alphabets to master

yyalphabetshotFixmaster都在同一个提交中。 在它们之间检查只是更改下一次提交将移动哪个分支头。

其他可能是内部HEAD运动,当你运行git pull时会发生这种运动。 git pullgit fetchgit merge的组合。

暂无
暂无

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

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