Commits, Branches, and Tags — What You Need to Know!

Learn how commits, branches, and tags interplay, and how to work proficiently with them!

Commits, Branches, and Tags — What You Need to Know!
Photo by Waldemar / Unsplash

To succeed with source code management in Git, one must understand how commits, branches, and tags interplay; these are all core components that make up your source code history.

Having read this post, you'll understand how they differ — conceptually as well as technically!


Before we dive into the details, let's brush up with this overview of a local repository to level the playing field.

Illustration of how commits, branches, tags, and HEAD interplay.

As you can see above, each component is technically either an object or a reference, with the tag being the odd one out as it can be created either as an object or reference. Being aware of the differences between an object and a reference makes your life with Git much easier, so here it goes.

💡
This post is for members only. Sign up and learn how to work proficiently with commits, branches, and tags! 🤓