From the course: Git: Branches, Merges, and Remotes

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Reference commits

Reference commits

From the course: Git: Branches, Merges, and Remotes

Start my 1-month free trial

Reference commits

- [Narrator] In this chapter, we're going to learn how to navigate the repository's commit tree. To do that, we need to start off by talking about the ways that we can reference commits. We've covered a few basic ways already And we should begin with introducing a new concept called tree-ish. A tree in Git is a directory which contains files and other directories. If you drew a picture of the directory Git uses the term tree-ish to refer to both trees and to identifiers which reference a tree. when that commit has been applied. If you go look up a Git command, it might say that you can use any tree-ish as a target of that command. In simple terms, a tree-ish is a directory, a commit, or a reference. Let's look at a few examples. You could have an SHA-1 hash, a tag reference, or the ancestry of one of those. There are more advanced examples, too, but these are the most common. We aren't ready to learn about branch and tag references, but let's look at the other three, starting with the…

Contents