Reputation: 2932
I have Netbeans 8.2 and as you can see I have two files ignored correctly in my project, these files are ".gitkeep" and "app.properties". But I want to exclude from ignore all the files that are under /vendor/Demo/librery/File directory, but I have to do something wront because I don't see their changes.
.gitignore file:
.vagrant/
vendor/*
vendor/bin/*
vendor/composer/*
vendor/container-interop/*
vendor/psr/*
vendor/zendframework/*
vendor/zfcampus/*
!vendor/Demo/*
config/development.config.php
data/cache/*
data/logs/*
!data/cache/.gitkeep
phpunit.xml
ubuntu-xenial-16.04-cloudimg-console.log
What am I doing wrong?
Edit 1:
I have made some changes in my .gitignore file and it doesn't work.
.gitignore file:
.vagrant/
vendor/bin/*
vendor/composer/*
vendor/container-interop/*
vendor/psr/*
vendor/zendframework/*
vendor/zfcampus/*
!vendor/Demo/*
config/development.config.php
data/cache/*
data/logs/*
!data/cache/.gitkeep
phpunit.xml
ubuntu-xenial-16.04-cloudimg-console.log
Edit 2:
More changes and it doesn't work.
.vagrant/
!vendor/
vendor/bin/*
vendor/composer/*
vendor/container-interop/*
vendor/psr/*
vendor/zendframework/*
vendor/zfcampus/*
!vendor/Demo/*
config/development.config.php
data/cache/*
data/logs/*
!data/cache/.gitkeep
phpunit.xml
ubuntu-xenial-16.04-cloudimg-console.log
Edit 3:
Why vendor is ignored?
.vagrant/
#!vendor/
#vendor/bin/*
#vendor/composer/*
#vendor/container-interop/*
#vendor/psr/*
#vendor/zendframework/*
#vendor/zfcampus/*
#!vendor/Demo/*
config/development.config.php
data/cache/*
data/logs/*
!data/cache/.gitkeep
phpunit.xml
ubuntu-xenial-16.04-cloudimg-console.log
Fixed it!!!
All the solutions given to me are right. The problem with NetBeans is that you have to close NetBeans, clean the cache folder of NetBeans and finally, open again NetBeans to see the changes previously made them in .gitignore file.
Upvotes: 1
Views: 2314
Reputation: 519
you should turn off "Ignore vendor
folder from versioning" here
and "Permanently ignore non-sharable" here
Upvotes: 2
Reputation: 1330102
But I want to exclude from ignore all the files that are under
/vendor/Demo/library/File
directory,
Fist ignore vendor content, not vendor itself (the folder).
That is because: It is not possible to re-include a file if a parent directory of that file is excluded.
/vendor/*
No need for all the other vendor/xxx
rules here.
Then exclude the folders for that ignore rule:
!/vendor/**/
Finally, exclude the files you want:
!/vendor/Demo/library/File/**
Upvotes: 2