Let's think about it this way for a second
This exercise set is meant as a quick self-test of the core skills you learned in the Basics chapter — initializing a repository, staging, committing, and ignoring files. It won't teach any new concepts; instead, it's about getting more fluent with the commands you've already learned through repetition. We recommend opening a terminal and actually running each task hands-on.
Exercises
Task 1: Create a new folder called 'my-notes', run git init, create a file called notes.txt, and commit it with the message 'Initial notes'. Task 2: Add two more lines to notes.txt, use git diff to look at the changes before committing, then commit. Task 3: Create a file called temp.log, add *.log to .gitignore, and confirm with git status that temp.log isn't being tracked. Task 4: Review the full commit history with git log --oneline.
Code Example
# Task 1
mkdir my-notes
cd my-notes
git init
echo "Meeting notes" > notes.txt
git add notes.txt
git commit -m "Initial notes"
# Task 2
echo "Follow up with team" >> notes.txt
echo "Review PR by Friday" >> notes.txt
git diff
git add notes.txt
git commit -m "Add follow-up items"
# Task 3
echo "debug output" > temp.log
printf "*.log\n" >> .gitignore
git status
# Task 4
git log --onelineAfter Task 4, git log --oneline shows two commits, and temp.log no longer appears anywhere in the git status output.Try it in 5 minutes
Instead of notes.txt, create a new file called second-notes.txt and redo Tasks 1-4 all over again from scratch (5 minutes).
A quick word of caution
Once a file has already been tracked with git add, just adding it to .gitignore won't untrack it — you need to untrack it first with git rm --cached <file>.