1) In command-line mode, load all desired files into your argument list (arglist)
:args `git grep -l <string>`
<string> is the string you want to replace.
2) Run a global search-replace across all the files in your arglist
:argdo %s/<string>/<replacement>/gce | update
- g[lobal]: replace all matches
- c[onfirm]: ask for confirmation before replacing
- e[rror]: don’t halt operation at errors
updatesaves each file after the replacement is made.
The search-replace will only apply to files checked into your git history. Be sure to commit the files you want searched before attempting this.