Comparing Branches
git diff a..b and git diff --stat compare branches. git log a..b lists commits.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git switch -q -c feat
echo f > f.txt && git add f.txt && git commit -qm 'feat'
git diff --stat main feat | tail -n 1
git diff --name-only main featResult
1 file changed, 1 insertion(+) f.txt
Exercise
Changed names.
git diff a b
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.