Laravel vendor files

Viewed 140

I am working on an application with laravel 8, whenever I run composer update 5000+ vendor files are tracked by GitHub however /vendor is added into the .gitignore file. here is a snap of my .gitignore file:

.gitignore image

1 Answers

Might be possible that you have already staged/added the vendor folder before putting in the .gitignore file. Or you have manually staged/added the folder to git through command.

In any case, one solution for you is to unstage the files by using

git reset /vendor/*

and if this doesn't solve your problem, then it might be possible that you already have committed older files into git; so, /vendor files are getting tracked by git.

Solution steps:

  1. Delete the /vendor folder.
  2. Make a clean commit of tracked files inside /vendor (if there are any)
  3. Run composer install again to get back /vendor folder.

After these steps, vendor will not be tracked. (Considering /vendor/ is still present in the .gitignore file)

Related