Skip to content

Board Games


Setup

Run the following commands to create a repo named boardgames with four commits.

cd path/to/parent/dir/
mkdir boardgames && cd boardgames && git init
git commit -m "initial commit"

touch board_games.txt
git add board_games.txt
git commit -m "add board_games.txt"

echo "Risk" > board_games.txt
git add board_games.txt
git commit -m "add Risk"

echo "Monopoly" >> board_games.txt
git add board_games.txt
git commit -m "add Monopoly"

echo "Pictionary" >> board_games.txt
git add board_games.txt
git commit -m "add Pictionary"

State of things

boardgames/
  board_games.txt
bill@gates:~$ git status
On branch main
nothing to commit, working tree clean
bill@gates:~$ git log --oneline
e0c559c (HEAD -> main) add Pictionary
8cabdfa add Monopoly
afaeaf4 add Risk
9b0a860 add board_games.txt

Challenge

Have a look at the commit graph.

The recent three commits are highly related. In scenarios like these, it's considered good practice to squash the commits into a single commit, to make the changes easier to view and understand.

Squash em!


See the solution