gitgithub
Ben Gorman

Ben Gorman

Life's a garden. Dig it.

Setup

This project contains a single file - haikus.txt - a collection of Haikus written by you. It starts with your first Haiku, Bugs :material-bug:.

cd path/to/parent/dir/
mkdir haiku && cd haiku
git init
 
echo "Bugs crawl through my code" > haikus.txt
echo "Destroying my work" >> haikus.txt
echo "I will fumigate" >> haikus.txt
 
git add haikus.txt
git commit -m "Completed Haiku: Bugs"

After completing your first Haiku, you begin work on a second one named Sunlight ☀️.

echo "" >> haikus.txt
echo "I yearn for sunlight" >> haikus.txt
echo "But here I code in the dark" >> haikus.txt

Clearly, you're still searching for that final phrase to complete your masterpiece. However, you notice a bug in your Bugs Haiku (lol, the irony 😆). The second line has 5 syllables instead of the required 7!

State of things

haiku/
  haikus.txt
bill@gates:~$ git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
  modified:   haikus.txt
bill@gates:~$ git log --oneline
0770486 (HEAD -> main) Completed Haiku: Bugs

Challenge

Create a new branch named bug-fix for fixing your Bugs Haiku. Once you've got it fixed, commit the change and merge it into main. Then proceed to finish and commit your second Haiku, Sunlight.


Solution

This content is gated

Subscribe to one of the products below to gain access