Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

reysagar's avatar

Unable to upload vendor folder in Git Repository

Hi,

I am trying to upload the Laravel project vendor folder on the git repository but maybe due to some issues on some packages I am not able to push the code, Also the file size was big so I used the lfs method to upload on the repository but still facing the same issue,

I thought the file was corrupted which is shown on the output but it was working fine, when I make other changes, or add new files/folders it just works fine not with the vendor folder.

Can you guys please help me out with how can I resolve it, I have tried all ways to resolve it but failed.

Output :

0 likes
5 replies
tisuchi's avatar

@reysagar I am thinking from a different perspective!

Why do you need the /vendor directory? What is the purpose for that to upload in the git?

Why I am asking for this?

  • Whoever downloads the project, just simply run
composer install
1 like
reysagar's avatar

I am new to laravel so I don't know much about it, one of the developers wants to join the project so I want to provide the git hub repo to him and collaborate on the project, while having access of all the files.

I researched what you have said, that it can be installed with the composer install, but I don't know if the third-party packages can be installed along with it, which is used on the project.

1 like
Snapey's avatar

Yes, you should NOT commit the vendor folder, and it should only contain things that are straight from the packages.

In your project you will have composer.json and composer.lock. These are important for your project.

When your colleague runs composer install, composer will review all the packages in the composer.lock file and install the same ones in their vendor folder.

2 likes
reysagar's avatar

Oh, Thank you so much @snapey for the clarification, I just have one more question,

What if I want to push the code to the server with that same repository? How I am going to run the code from the hosting server without the vendor folder,

Like, I will push the code on the git repo and that repo is connected with the cloud server somewhere, It will allow me to do changes in real time, do we have to manually add that vendor file on the server?

chiefguru's avatar

@reysagar you simply run composer install on the deployment server and it will install the files required by the composer.lock

Please or to participate in this conversation.