Created
October 4, 2014 03:44
-
-
Save miraculixx/5888638d71c7dcc8167b to your computer and use it in GitHub Desktop.
create .keep files for empty directories currently ignored by git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create .keep files for empty directories currently ignored by git | |
# run git clean -nd to see which directories are empty and therefore ignored by git currently | |
# run git keep to add these directories by adding a .keep file | |
# see this discussion http://stackoverflow.com/questions/115983/how-do-i-add-an-empty-directory-to-a-git-repository/21422128#21422128 | |
git clean -nd | awk '{ print $3 }' | xargs -L1 -I{} touch {}.keep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is exactly what I needed, rock on.