git log -S <string to find> --source --all
To find all commits that added or removed the fixed string string to find. The --all
parameter means to start from every branch and --source
means to show which of those branches led to finding that commit.
git branch --contains <commit>