Skip to content

Instantly share code, notes, and snippets.

@luisfaceira
Created September 15, 2011 10:52
Show Gist options
  • Save luisfaceira/1218997 to your computer and use it in GitHub Desktop.
Save luisfaceira/1218997 to your computer and use it in GitHub Desktop.
Oneliner to prepare empty directories for svn2git conversion
find -not -path "*/.svn/*" -type d -empty -exec sh -c "echo This directory was empty. This file let's it be git-compatible. > {}/README.emptydir" \;
@luisfaceira
Copy link
Author

If anything is found, one must also add those just-created files with svn-add. Not sure how to that in the one-liner inside the find's exec option.

@luisfaceira
Copy link
Author

In svn there actually exists no empty dir since every single on has the hidden ".svn" folder, so this way of searching them won't work on a checked out repo, just on an export.

This means there are some adaptations needed.

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