Part of the Git, Zero to Hero
Build & submit taskBetaadvanced

Build a Commit with Plumbing Only

Add a recipe to a repository without git add or git commit: write the blobs, stage them, write the tree, make the commit, move the branch and tag it with Git's plumbing commands, then bring the files on disk in line. A local self-check verifies the objects and the history and writes your submission for instant, rubric-based feedback.

35 min

Est. time

3

Outcomes

4

Rubric criteria

60%

Pass score

What you'll learn

Skills you'll have real reps in after shipping this.

A commit is a tree, its parents, an author, a committer and a message; a branch is a name holding its ID.
Blob and tree IDs depend only on contents, names and modes, so they match on every computer; commit IDs also include who and when.
Porcelain commands are conveniences over plumbing: git add is hash-object plus update-index, git commit is write-tree, commit-tree and update-ref.

The scenario

Bean There wants a scone recipe on its website: a new file in the recipes folder, and a new line on the menu.

This time you build the commit the way Git does inside: every blob, the trees, the commit object and the branch move by hand, with the plumbing commands git add and git commit run for you.

Your role

You are the developer proving you understand Git's object model. Your deliverable is a commit made only with plumbing commands, with exact contents and the kit's commit as its parent, main moved to it with git update-ref and a reflog message, a lightweight tag on it, a matching working tree, and notes explaining each step.

Start the task to unlock the full brief

You'll get the step-by-step requirements, setup commands, the 4-criterion grading rubric, tips, and the ability to submit your solution for instant AI grading.

Free to start · submit when you're ready

Learn Git's object model by building a commit by hand

The fastest way to understand Git is to make a commit without git add or git commit. This kit gives you a small repository and two files to add. You write the blobs with git hash-object, stage them with git update-index, write the tree, create the commit with git commit-tree and move the branch with git update-ref, checking the IDs as you go. A local self-check verifies every object and the reflog and writes your submission only when it genuinely passes. It is the Level 6 project in Preporato's Git course.

Frequently asked questions

Why would anyone build a commit by hand?

You won't in daily work, but doing it once shows exactly what a commit, a tree and a branch are. Merges, rebases and resets stop being mysterious, and scripts and tools that use plumbing commands make sense.

How does the check know I didn't use git commit?

Every git commit writes a 'commit:' entry into HEAD's reflog, while git update-ref -m writes the message you give it. check.sh looks for the first kind and requires the second.

Will my IDs match the ones in the lessons?

Your blob and tree IDs will, because they depend only on contents and names. Your commit ID won't: it includes your name and the time you made it.