-
-
Save kongondo/b9a1c729b2fbdeca7bd4d326735ecb10 to your computer and use it in GitHub Desktop.
Gitignore - Exclude all except specific 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
# | |
# If all files excluded and you will include only specific sub-directories | |
# the parent path must matched before. | |
# | |
/** | |
!/.gitignore | |
############################### | |
# Un-ignore the affected subdirectory | |
!/libraries/ | |
# Ignore subdirectory and all including directories and files to match pattern as valid for the next pattern | |
/libraries/** | |
# This pattern only works with the two previous patterns | |
# (i remember it was working alone on older git versions) | |
!/libraries/myLibrary/ | |
############################### | |
# Another example | |
!/templates/ | |
/templates/** | |
!/templates/myTemplate/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment