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.
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 sitecommit. Keep them and add the new ones underneath. If you clear the editor you will seefatal: not a git repository.
Try 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"
# Your commands below
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 IgnorePractice on your own: Terminal playground