[英]What is the 2nd column in the git reflog?
I just did a simple git reflog
and this is the first few lines I got: 我刚做了一个简单的
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
I'm trying to understand what each column represents. 我试图了解每列代表什么。 Reading from this post and this question I've already learned:
从这篇文章和这个问题中读到我已经学到了:
HEAD@{0}
to HEAD@{7}
concept. HEAD@{0}
到HEAD@{7}
概念。 Don't get the parts that are in the parenthesis! (yy, alphabets, hotFix)
represent? (yy, alphabets, hotFix)
代表什么? Additionally I'm uncertain as to why there is multiple lines of the same commit? 另外我不确定为什么同一次提交有多行? Is it because different branches are all pointing to the same commit and there is no code changes between them?
是因为不同的分支都指向同一个提交,它们之间没有代码更改?
The reflog tells you how HEAD
has moved. reflog告诉你
HEAD
是如何移动的。 There are more than three columns. 有三列以上。 The Git docs are obtuse about this.
Git文档对此很迟钝。 It turns out
git reflog
is just an alias for git log
with some switches. 事实证明,
git reflog
只是git log
一个别名,带有一些开关。
git reflog show
[the default] is an alias forgit log -g --abbrev-commit --pretty=oneline;
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
The abbreviated commit. 784f2cp3
缩写提交。 (yy, alphabets, hotFix)
The branch heads at this commit, just like git log --decorate
. (yy, alphabets, hotFix)
分支负责此提交,就像git log --decorate
。 HEAD@{7}
The location of this commit relative to HEAD
, added by -g
. HEAD@{7}
此提交相对于HEAD
的位置,由-g
添加。 checkout
What command was run. checkout
运行了什么命令。 moving from alphabets to master
A human readable description. moving from alphabets to master
人类可读的描述。 (4 and 5 are technically the same column.) (4和5在技术上是相同的列。)
This says you were on branch alphabets
and ran git checkout master
. 这说你在分支
alphabets
运行git checkout master
。
Additionally I'm uncertain as to why there is multiple lines of the same commit?
另外我不确定为什么同一次提交有多行? Is it because different branches are all pointing to the same commit and there is no code changes between them?
是因为不同的分支都指向同一个提交,它们之间没有代码更改?
Yes, exactly. 对,就是这样。
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
, and master
were all on the same commit. yy
, alphabets
, hotFix
和master
都在同一个提交中。 Checking out between them simply changes which branch head will be moved the next commit. 在它们之间检查只是更改下一次提交将移动哪个分支头。
The others might be internal HEAD
movements which happen when you run git pull
. 其他可能是内部
HEAD
运动,当你运行git pull
时会发生这种运动。 git pull
is a combination of git fetch
and git merge
. git pull
是git fetch
和git merge
的组合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.