Finding Changes with log -S
git log -S finds commits that added or removed a piece of text.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
echo 'needle' >> a.txt && git commit -qam 'Add needle'
echo 'x' >> a.txt && git commit -qam 'Other'
git log -S needle --format=%sResult
Add needle
Exercise
Search history.
git log text
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.