I have a folder under version control. I want to make a copy of it to send around, but don\'t want to include all the .git directories and the files underneath it.
Is
ls | xargs find 2>/dev/null | egrep /\.git$ | xargs rm -rf
This command (and it is just one command) will recursively remove .git directories (and files) that are in a directory without deleting the top-level git repo, which is handy if you want to commit all of your files without managing any submodules.
find 2>/dev/null | egrep /\.git$ | xargs rm -rf
This command will do the same thing, but will also delete the .git folder from the top-level directory.