Last active
October 11, 2015 19:08
-
-
Save ncimino/3905536 to your computer and use it in GitHub Desktop.
Git Ignore All Except
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
* | |
!/a | |
/a/* | |
!/a/b | |
/a/b/* | |
!/a/b/c | |
/a/b/c/* | |
!/a/b/c/foo | |
# don't forget this one | |
!.gitignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what is needed to mask all files in all nested directories, except the foo file:
don't ignore dir a
!/a
ignore everything in dir a
/a/*
don't ignore dir b
!/a/b
ignore everything in dir a
/a/b/*
don't ignore dir c
!/a/b/c
ignore everything in dir a
/a/b/c/*
don't ignore file foo
!/a/b/c/foo
don't forget this one
!.gitignore