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
EasyCreate 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.
Cheat sheet
To stage a specific file and commit it:
git add recipes/pizza.md
git commit -m "Add pizza recipe"To view commit subjects from oldest to newest:
git log --reverse --pretty=%sTry it yourself
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"
git log -1 --pretty=%s
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Version Control
2Getting Started
Initialize A RepositoryThe .git FolderConfigure Your IdentityGit StatusRecap - First Repo8Merging
What Is A MergeFast-Forward MergeThree-Way MergeMerge ConflictsResolve A ConflictRecap - Merge Master11Feature Branch Project
Project OverviewInitialize Main3Tracking Changes
The Staging AreaGit AddGit CommitModifying A Tracked FileGit LogRecap - First Commits6Recipe Site Project
Project OverviewInitialize And Ignore