[英]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
我试图了解每列代表什么。 从这篇文章和这个问题中读到我已经学到了:
HEAD@{0}
到HEAD@{7}
概念。 不要得到括号内的零件! 。 (yy, alphabets, hotFix)
代表什么? 另外我不确定为什么同一次提交有多行? 是因为不同的分支都指向同一个提交,它们之间没有代码更改?
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
784f2cp3
缩写提交。 (yy, alphabets, hotFix)
分支负责此提交,就像git log --decorate
。 HEAD@{7}
此提交相对于HEAD
的位置,由-g
添加。 checkout
运行了什么命令。 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
yy
, alphabets
, hotFix
和master
都在同一个提交中。 在它们之间检查只是更改下一次提交将移动哪个分支头。
其他可能是内部HEAD
运动,当你运行git pull
时会发生这种运动。 git pull
是git fetch
和git merge
的组合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.