Git has the .gitignore file which is for a blacklist on excluded files/folders.
Is there an adversary function to this? Here is my use case.
BigDir/
DirAA/
DirAB/
DirAC/
DirAD/
DirAE/
.....
Is there a way to just say "allow only these directories?" (a whitelist)
Maybe something like...
DirAA/
DirAC/
which would result in All other directories BUT DirAA and DirAC to be ignored.
I would just add each other directory to the .gitignore but these folders keep growing, and I wouldn't want to keep adding each new folder.
Per help from @amalbala's comment, this is how I can achieve what i want:
# first ignore everything
*
# then don't ignore the root directory
!*/
# now whitelist the particular directories and all files within them
!DirAA/*
!DirAC/*
This will result in everything being ignored, BUT DirAA/ and DirAC/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With