Sunday, November 11, 2018

Lesson 5.1 Relative Refs (^)

1. Move  up commit :
  • Moving upwards one commit at a time with ^
  • Moving upwards a number of times with ~<num>.
We can say: 

So saying master^ is equivalent to "the first parent of master". 
master^^ is the grandparent (second-generation ancestor) of master
Example:
Command type: git checkout master^  













Other example:

Branch start:                        Branch goal:
                             

Answer:
  • git checkout C3; 
  • git checkout HEAD^;
  • git checkout HEAD^; 
  • git checkout HEAD^