git查看分支历史动向记录

2023-03-23  本文已影响0人  kingTao_

git查看分支历史动向记录

git reflog --date=local |grep branchname

$ git reflog --date=local | grep test2

39cca77 HEAD@{Fri Mar 24 15:18:52 2023}: merge test2: Fast-forward // master分支执行 git merge test2
19e2ef4 HEAD@{Fri Mar 24 15:18:48 2023}: checkout: moving from test2 to master // git checkout master
39cca77 HEAD@{Fri Mar 24 15:18:05 2023}: commit: test2 // test2分支 git commit -m "test2"
f5a8528 HEAD@{Fri Mar 24 15:17:48 2023}: checkout: moving from test1 to test2  // test1分支执行 git checkout test2【这一行不能说明test2从test1检出】

git 查看分支来源和commit记录

git reflog show branchname

$ git reflog show test2
69b949a (HEAD -> master, test3, test2) test2@{0}: commit: test2 // test2 commit
dae0eeb (test1) test2@{1}: branch: Created from HEAD // test2来源于test1

$ git reflog show test3
69b949a (HEAD -> master, test3, test2) test3@{0}: branch: Created from HEAD // test3来源于test2,master, test3, test2无差别

$ git reflog show test4
4740e0b (test5, test4) test4@{0}: commit: test4 // test4 commit
69b949a (HEAD -> master, test3, test2) test4@{1}: branch: Created from HEAD // test4来源于test2,master, test3, test2无差别

上一篇下一篇

猜你喜欢

热点阅读