I had to search and replace few APIs in a big code base. Therefore, I went for stream editor (sed) rather than using IDE
find . -not -iwholename '*.git*' -print -exec sed -i 's/<old_pattern>/<new_pattern>/g' {} \;
After applying the command git was not able to track (git status, nothing!) my changes anymore. I did exclude '.git' dir but still somehow my local repo was broken. I followed, How to fix corrupted git repository? but I wonder what broke local repo in the first place when '.git' was not touched?