Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

1 Learning

Dive into Git

Go to https://try.github.io/ and look for the "Learn by reading" and "Learn by doing" sections.

Browse the "Pro Git book" at https://git-scm.com/book.

Strengthen your knowledge

Make sure you are familiar with the following terms:

Make yourself familiar with git reflog, see here for a short introduction.

Make yourself familiar with interactive rebasing.

Some useful revisions to know:

  • HEAD: references the current commit
  • ORIG_HEAD vs. HEAD@{1}: See https://stackoverflow.com/a/967611/704821
  • naked @: same as HEAD
  • @^ and @~: references the parent of the current commit
  • @^2: references the second parent of the current commit (for merge commits)
  • @~2: references the 2nd generation parent of the current commit, i.e. the parent of the parent
  • @^^^ and @~~~ and @~3 are equivalent
  • @{FOO} when FOO is not a number: same as HEAD@{foo}
  • @{u}: the current upstream, e.g. origin/main

Hint: You can de-reference a revision with git rev-parse REVISION.

Cheat sheets

Some useful cheat sheets:

More


1 Learning | 2 Best practices »