Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create empty gitkeep files in directories that are empty
find . -type d -empty -exec touch {}/.gitkeep \;
@sivakumar-kailasam

This comment has been minimized.

Copy link

commented Mar 17, 2016

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

@florinlamba

This comment has been minimized.

Copy link

commented Sep 21, 2017

what about in Windows ? how to do it ?

@florinlamba

This comment has been minimized.

Copy link

commented Sep 21, 2017

i have used/ installed cygwin :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.