A Worked Example

Understand the concept of “squashing commits” with the help of an example.

We'll cover the following

Setup

Type this in to begin the process of working through a real example of squashing and understand what it is:

1	mkdir lgthw_squashing
2	cd lgthw_squashing
3	git init
4	touch afile
5	git add afile
6	git commit -m "Initial commit"
7	for i in {1..10}
8	> do
9	> echo $i >> afile
10	> git commit -am "commit:${i}"
11	> done
12	git status
13	git log

Get hands-on with 1200+ tech skills courses.