DEV Community

Discussion on: πŸŒ³πŸš€ CS Visualized: Useful Git Commands

Collapse
 
codypearce profile image
Cody Pearce

Awesome visualizations as usual!

It's interesting there's a few different syntaxes for selecting a previous commit:

HEAD~2          // previous two commits fro head
HEAD~~         // previous two commits from head
HEAD@{2}     // reflog order
18fe5              // previous commit hash
Enter fullscreen mode Exit fullscreen mode
Collapse
 
lydiahallie profile image
Lydia Hallie

Good idea to add that! I'm thinking of generally creating a "cheatsheet" format that also covers all that stuff :) Will do in the next one or when I update the format πŸ˜„

Collapse
 
toby profile image
toby • Edited

Came here to comment specifically along these lines - I can never ever remember what the difference between HEAD~2 and HEAD^2 is !

Had completely forgotten about HEAD@{n} syntax :D