git-noms-data-models | module:

Git Internals - Hash Objects

Prerequisites

In order to understand the steps in this tutorial, you should be familiar with:

Goals (Learning Objectives)

After doing this tutorial you will know how to

Activities

Step 1: Keep a notepad for hashes

Open a text file that you can write notes into while you work.

While going through these lessons, whenever a git command returns a hash, copy that hash, paste it into the notepad and add a note so you can remember what content that hash points to.

This is because future steps might ask you to use that hash as the input for a command.

Step 2: Introduction

Read the introduction to the Git Internals chapter of the Official Git Book: Git Internals - Plumbing and Porcelain

Step 3: Git Internals - Hash Objects

Read the first section of the page on Git Internals - Git Objects. Stop at the heading ‘Tree Objects’. We will cover that in the next lesson.

Step 4: Inspect the Hash Objects You’ve Created

Run

git status

You should see output like:

On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	test.txt

There is one untracked file called ‘test.txt’. It hasn’t been staged or committed to git yet. In the next lesson you will learn the internal commands git uses to stage that file.

Next Steps

Proceed to the Tree Objects lesson.