Created
August 8, 2013 02:54
-
-
Save creativecoder/6181048 to your computer and use it in GitHub Desktop.
.gitignore all but the specified subdirectory
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
# Ignore all files except for a particular directory | |
* | |
# Don't ignore directories themselves, else we can't add anything to the repository | |
!*/ | |
# Don't ignore any directory with the name "path" | |
!**/path/* | |
# or its subdirectories | |
!**/path/**/* | |
# And don't forget .gitignore itself | |
!.gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment