Menu
Coddy logo textTech

Inspect The History

Part of the Version Control section of Coddy's Terminal journey — lesson 27 of 58.

The Cookbook repo now has a small but real history: an initial commit and a follow-up that adds a recipe.

Inspecting the history is the easiest way to confirm the work is in shape. You will print the commit count, the list of files that ended up in the latest commit, and confirm the build artifact stayed out of the repo.

challenge icon

Challenge

Beginner

Print the total number of commits using git rev-list --count HEAD.

The repo already has both commits applied for you.

Cheat sheet

Count total commits in a repository:

git rev-list --count HEAD

Try it yourself

Terminal
git init -q -b main
git config user.name "Cookbook Dev"
git config user.email "dev@coddy.tech"
echo "*.log" > .gitignore
git add .
git commit -q -m "Initial site"
echo "# Pizza" > recipes/pizza.md
git add recipes/pizza.md
git commit -q -m "Add pizza recipe"
git log --reverse --pretty=%s
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Version Control