1.2 Git Basics: The Three Trees
In this lesson, I’ll explain Git’s three trees. You’ll see the role of each and how they interact as code is updated and committed.
- The working directory is where new changes are made to the codebase. You can edit, create and delete files directly in the working directory.
- The index is where changes are staged. Files are
added to the index, where they are prepared for packaging in a commit object.
- The HEAD is a pointer to a specific branch and commit in the repository. Files are checked out from the HEAD to the working directory and are
committed from the index to the branch pointed to by HEAD.