0

Making pull of Laravel 5 app from external branch I got several conflict errors like

error: refusing to lose untracked file at 'vendor/composer/autoload_static.php'                                                                                                                                        
CONFLICT (modify/delete): vendor/composer/autoload_real.php deleted in HEAD and modified in b871903544566b6c1fd662ac67e7987f1ecc8643. Version b871903544566b6c1fd662ac67e7987f1ecc8643 of vendor/composer/autoload_real.php left in tree.                                                                                                                                                                                                     

but in .gitignore file I have vendor directory:

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea

.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

composer.lock
package-lock.json
1.txt

I wonder why such errors and how to fix them? I suppose there is no sense in manually editing files inside of /vendor ?

Thanks!

mstdmstd
  • 2,195
  • 17
  • 63
  • 140

1 Answers1

1

that's not a normal vendor package, it the autoload generated by composer.

Run this command to generate the file anew to fix the error.

compser dump-autoload

But what you really should do is to remove the autoload from your git:

  • delete the tracked file & commit the change
  • add it to the ignore list (it should be already ignored)
  • push
  • run command dump-autoload on every installation after pull

OR follow these instructions How to stop tracking and ignore changes to a file in Git? and the do step 4

N69S
  • 16,110
  • 3
  • 22
  • 36