Skip to content

Instantly share code, notes, and snippets.

@artlantis
Last active February 27, 2023 08:18
Show Gist options
  • Select an option

  • Save artlantis/350203d2cef18c42ec239d7c0f4b9a07 to your computer and use it in GitHub Desktop.

Select an option

Save artlantis/350203d2cef18c42ec239d7c0f4b9a07 to your computer and use it in GitHub Desktop.
/*
* Thanks to Eric Leschinski
* https://stackoverflow.com/a/20081410/147437
*/
// find out the directories that you want to remove
find . -type d -name ".git" \
&& find . -name ".gitignore" \
&& find . -name ".gitmodules"
// then remove all sub folders that you specified
( find . -type d -name ".git" \
&& find . -name ".gitignore" \
&& find . -name ".gitmodules" ) | xargs rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment