I'm trying to whitelist the directory (and its contents) SupplierName in my Zend Framework 2 vendor directory.
The original .gitignore file in /vendor looks like this:
# Add here the vendor path to be whitelisted
# Ex: for composer directory write here "!composer" (without quotes)
!.gitignore
*
Now I'd like to whitelist the directory SupplierName which shouldn't be too hard I thought. I have read the docs on gitignore and tried the following configurations:
First try, add !SupplierName right after the comment which says that I have to add the whitelisted path here.
# Add here the vendor path to be whitelisted
!SupplierName
# Ex: for composer directory write here "!composer" (without quotes)
!.gitignore
*
Right after that I executed git status
which didn't show the vendor/SupplierName directory. git add vendor/SupplierName
showed the following message:
The following paths are ignored by one of your .gitignore files: vendor/SupplierName
Second try
# Add here the vendor path to be whitelisted
# Ex: for composer directory write here "!composer" (without quotes)
!SupplierName
!.gitignore
*
Right after that I executed git status
which didn't show the vendor/SupplierName directory. git add vendor/SupplierName
showed the following message:
The following paths are ignored by one of your .gitignore files: vendor/SupplierName
Third try
# Add here the vendor path to be whitelisted
# Ex: for composer directory write here "!composer" (without quotes)
!.gitignore
*
!SupplierName
Right after that I executed git status
which didn't show the vendor/SupplierName directory. git add vendor/SupplierName
seems to work. But now, when I want to add the Module.php file (and some other files, subdirectories, etc) the following happens. git add vendor/SupplierName/Module.php
-->
The following paths are ignored by one of your .gitignore files: vendor/SupplierName/Module.php
# Add here the vendor path to be whitelisted
# Ex: for composer directory write here "!composer" (without quotes)
*
!.gitignore
!SupplierName
!SupplierName/
!SupplierName/*
Allows me to add files directly in vendor/SupplierName, but git add vendor/SupplierName/config/module.config.php
still results in
The following paths are ignored by one of your .gitignore files: vendor/SupplierName/config/module.config.php
I've been searching for problems regarding recursive whitelisting, because that seems to be the problem, but nothing came up.
See Question&Answers more detail:
os