It would not have exactly the same meaning (it would delete any `.git` directories instead of just deleting submodule `.git` files), but I guess it should not be a problem.
`find -name .git -prune -exec rm -rf {} \;` would be better to avoid `find` trying to scan a directory it just deleted.