我刚刚做了一个简单的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} to HEAD@{7}的概念。不要得到括号中的部件!。(yy, alphabets, hotFix)代表什么?此外,我不知道为什么有多行相同的提交?是因为不同的分支都指向相同的提交,并且它们之间没有代码更改吗?
发布于 2018-02-05 19:54:47
reflog告诉您HEAD是如何移动的。有三列以上。吉特的医生们对此很迟钝。事实证明,git reflog只是带有一些交换机的git log的别名。
git reflog show默认值是git log -g --abbrev-commit --pretty=oneline;的别名
784f2cp3 (yy, alphabets, hotFix) HEAD@{7}: checkout: moving from alphabets to master784f2cp3缩写为commit。(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 masteryy、alphabets、hotFix和master都处于相同的提交状态。在它们之间签出只需更改下一次提交时将移动哪个分支头。
其他的可能是在运行HEAD时发生的内部git pull运动。git pull是git fetch和git merge的组合。
https://stackoverflow.com/questions/48630217
复制相似问题