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"
Working Tree git status
git log
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!
Solution 1¶
This content is gated
Subscribe to one of the products below to gain access
Solution 2¶
This content is gated
Subscribe to one of the products below to gain access