You want to find and replace all instances of a string in your repo, so you google "find replace directory linux command". You end up here
https://stackoverflow.com/a/6759339/2129219
They tell us
Ignoring the fact that this syntax is very long and hard to type, this command is dangerous to use in a git repository. Specifically, this can corrupt your .git contents.
This command is dangerous because, find . will enumerate dotfiles, including the .git directory, and then of course will run the find and replace inside them. We can see this in the following session
In this case, you may be able to recover it e.g. with https://stackoverflow.com/questions/1115854/how-to-resolve-error-bad-index-fatal-index-file-corrupt-when-using-git
If you happened to replace some random text that is actually in an object file though e.g. .git/objects
My take: Use ruplacer https://github.com/dmerejkowsky/ruplacer
This tool won't try to replace stuff in your .git directory. It will also skip anything in .gitignore including e.g. node_modules. I was delighted to discover this tool so, just spreading the word
Addendum: Reddit /u/Snarwin also recommended using git ls-files instead of find