grep -rl 'oldName' src | xargs sed -i 's/oldName/newName/g'
grep -rl lists the files that contain the text, sed -i edits them in place. On macOS sed -i needs an argument; use sed -i ''.
Use a different delimiter when the text has slashes in it, any character works:
sed -i 's#/var/www/old#/var/www/new#g' /etc/nginx/sites-available/*
Run the grep on its own first to see which files you're about to touch. And commit before you start, so git diff shows what changed and git checkout . undoes it.