So I made a horrible mistake, I've most probably pushed node_modules before adding them to .gitignore, and now all my branches (I use gitflow) have node_modules in it.
Is there a way to dynamically delete node_modules per all branches? I can do it manually, of course, but I was wondering if I could write a git script for it.
I've found git for-each-ref, but don't really understand it that well.
I guess something like git for-each-ref rm -r --cached node_modules
, but am not sure how to translate this correctly.