[英]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.