i have .gitignore
file with contant as follows:
# Cache, session files and logs (Symfony3)
/var/*
/var/sessions/*
/web/dist/*
/download/*
/vendor/composer/*
/vendor/*
*.lock
*.zip
*~
# Parameters
/app/config/parameters.yml
/app/config/parameters.ini
# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements
# Backup entities generated with doctrine:generate:entities command
**/Entity/*~
# Embedded web-server pid file
/.web-server-pid
but i have few files that should be excluded but git want to stage them. For example:
var/cache/dev/appDevDebugProjectContainer.php var/cache/dev/appDevDebugProjectContainer.php.meta
The .gitignore is just a guide, you can implicitly add files regardless of the gitignore.
So if you added the files implicitly to version control, or they got committed before you added .gitignore masking, then you have to delete them, and commit the delete, so git won't track them. Or you can leave them there, but git will try to stage them, or maybe try git rm --cached <file>
, it will remove the file from the index, meaning git will forget it.