Skip to content

Instantly share code, notes, and snippets.

@adrianratnapala
Created October 29, 2011 05:18
Show Gist options
  • Save adrianratnapala/1324128 to your computer and use it in GitHub Desktop.
Save adrianratnapala/1324128 to your computer and use it in GitHub Desktop.
Shell one-liner to add empty .hgignore to all empty directories in a git repository.
find -type d -empty | sed '/^\.\/\.git/d' | xargs -I{} touch '{}/.gitignore'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment