Your vendor directory is checked in to the repo. To remove it, go to your git repo root and run:
git rm -r –cached vendor
This will recursively (due to -r flag) remove vendor from your git repo. The –cached flag will keep the local copy of vendor directory in tact. Note that if there are other devs working with the repo, their copy of the vendor directory will be removed and they will need to bundle install again.
Once you’ve untracked the directory in git, you can commit the change using:
git commit -m “untrack vendor directory”
Thereafter, .gitignore will happily ignore any changes within the vendor directory next time onwards.
Also, you don’t need your entries in .gitignore to begin with a /. Use the / when you want to ensure that only files/folders in root directory are ignored, and any file in a subdirectory matching the pattern should not be ignored.
and then run the following command
composer update –no-scripts