Concepts

Review Git Fundamentals

Git Commits & Branches

A lot of the confusion about git comes from the naming of its commands. For instance, a commit often misleads people into thinking it encapsulates the difference between two states of a repository. This is incorrect.

Let's clear up some of this confusion:

A commit is simply a complete snapshot of the entire repository at a given time. No more, no less. It's kind of like looking at a version of your files frozen at a certain time.

A branch is simply a pointer to a specific commit in the tree of commits.

Thus a git repo is simply a tree of commits with pointers at various nodes in the tree.

(C1) -> (C2)
           ^ HEAD: Master     

Other concepts

  • What is the HEAD?

    • HEAD is what the current branch is. HEAD refers to the branch that is checked out

  • What is a tag?

    • Tags can be used to mark certain versions/releases of a given application. Think of this as a bookmark to a certain commit.

Last updated

Was this helpful?