Skip to content

Instantly share code, notes, and snippets.

@simoncoulton
Created January 8, 2014 05:42
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save simoncoulton/8312372 to your computer and use it in GitHub Desktop.
Save simoncoulton/8312372 to your computer and use it in GitHub Desktop.
Create empty gitkeep files in directories that are empty
find . -type d -empty -exec touch {}/.gitkeep \;
@sivakumar-kailasam
Copy link

find . -type d -empty -not -path '*/\.*' -exec touch {}/.gitkeep \; will ignore empty directories inside the .git folder 😄

@florinlamba
Copy link

what about in Windows ? how to do it ?

@florinlamba
Copy link

i have used/ installed cygwin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment