Chapter 4. Edit & Commit

HEAD and INDEX

When you start working with Git, you'll see the terms HEAD and INDEX frequently. Here are the definitions of these terms.

HEAD

The latest commit (the latest version) is called HEAD. As you can create many commits during your coding project, having a special name for the latest commit is useful.

The concept of HEAD is also useful for understanding the branch workflow which will be explained in Chapter 5.

To indicate one commit before HEAD, you can use HEAD~ (tilde) or HEAD^ (Caret). The meaning of ~ and ^ will be different in a multi-branch context. It will be explained in the next chapter.

INDEX

INDEX is another term for the staging area as was already explained before. From this page onwards, we use INDEX instead of Staging Area.

When you start working with Git, you'll see the terms HEAD and INDEX frequently. Here are the definitions of these terms.

HEAD

The latest commit (the latest version) is called HEAD. As you can create many commits during your coding project, having a special name for the latest commit is useful.

The concept of HEAD is also useful for understanding the branch workflow which will be explained in Chapter 5.

To indicate one commit before HEAD, you can use HEAD~ (tilde) or HEAD^ (Caret). The meaning of ~ and ^ will be different in a multi-branch context. It will be explained in the next chapter.

INDEX

INDEX is another term for the staging area as was already explained before. From this page onwards, we use INDEX instead of Staging Area.