gitgithub
Ben Gorman

Ben Gorman

Life's a garden. Dig it.

Setup

This project contains a single file - your recipe for the best pizza 🍕.

cd path/to/parent/dir/
mkdir pizza && cd pizza
git init
 
echo "dough" > pizza.txt
echo "tomato sauce" >> pizza.txt
echo "cheese" >> pizza.txt
 
git add pizza.txt
git commit -m "basic pizza"

After setting up the project you decided to experiment with some changes, so you make a new branch named tinkering and get to work 👨‍🔬.

git checkout -b "tinkering"
 
echo "pepperoni" >> pizza.txt
echo "spinach" >> pizza.txt
echo "pineapple" >> pizza.txt
 
git add pizza.txt
git commit -m "added pepperoni, spinach, and pineapple"

Then you decide to revisit the base pizza on the main branch. While you're there, you make some edits..

git switch main
 
echo "pineapple" >> pizza.txt
echo "spinach" >> pizza.txt
echo "chicken" >> pizza.txt
 
git add pizza.txt
git commit -m "added pineapple, spinach, and chicken"

Challenge

Merge the tinkering branch into the main branch to create a pizza with all the ingredients

  • dough
  • tomato sauce
  • cheese
  • pepperoni
  • spinach
  • pineapple
  • chicken

Solution

This content is gated

Subscribe to one of the products below to gain access