Menu
CoddyTech

Add A Second Recipe

Part of the Version Control section of Coddy's Terminal journey. Lesson 26 of 58.

The Cookbook now has its initial commit. Time to add a second recipe and capture it in its own commit.

You will create a new file recipes/pizza.md, write a title into it, then stage and commit only that file. The result is a history with two focused commits, each one telling a clear story.

challenge icon

Challenge

Easy

Create recipes/pizza.md with the contents # Pizza (followed by a newline). Stage just that file, and commit with the message Add pizza recipe.

Then print the commit subjects from oldest to newest using git log --reverse --pretty=%s.

Note: every run starts from a fresh copy of the project folder, so the whole script in the editor runs again from the top. The editor starts with the commands of the previous steps, the ones that initialize the repository and make the Initial site commit. Keep them and add the new ones underneath. If you clear the editor you will see fatal: not a git repository.

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"
# Your commands below
quiz iconTest yourself

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

All lessons in Version Control

Practice on your own: Terminal playground