let's head @ final commit in master, , log looks this
$ git log --oneline bcaee1c 15 july update 02ff17a add feature x 0910b6f end of weekly update c2b7189 add 03 july update 737be94 add feature y now want go @ past:
$ git checkout 0910b6f now log shows no hint of more recent state -- relative future head
$ git log --oneline 0910b6f end of weekly update c2b7189 add 03 july update 737be94 add feature y ok, no problem, "remember" or "write down" furthest-ahead commit bcaee1c , can git checkout bcaee1c, bammo, here comes phone call, bunch of emergency meetings, forced reboot, weekend, , "forget" , / or lose sticky note. come (much) later mental context blown , start creating away, discover later i've messed , have forensics job reset , revert , rewind.
can git log show future of head? there better git-fu scenario?
two things you:
1 @ tip of branch (master in case):
git checkout master 2 git log show commits, , not starting head: use --all
git log --oneline --all note in case, git checkout master , git checkout bcaee1c might seem same, isn't exactly; must checkout branch; otherwise remain in detached head state.
edit 2 one-line command use lot have overview of whole tree:
git log --all --online --decorate --graph
Comments
Post a Comment