Yii Framework Forum: Yii2.0.9 - Vendor folder doen't push on github repo. - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii2.0.9 - Vendor folder doen't push on github repo. Rate Topic: -----

#1 User is offline   Dhb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-October 16

Posted 01 November 2016 - 06:57 AM

Hello there,

I have build web app in Yii-2.0.9 and its working very well in local and live. but i want to upload whole code in github repository. all folders/files upload successfully except the vendor folder. i tried many to upload "Vendor" folder on github repository. but i didn't get success on it.

So, have you any idea about that? why is not uploading "Vendor" folder on github repository?

Please help me on this

Thanks
0

#2 User is offline   Gustavo Andrade 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 200
  • Joined: 16-August 11
  • Location:Brazil - MG

Posted 01 November 2016 - 07:45 AM

View PostDhb, on 01 November 2016 - 06:57 AM, said:

Hello there,

I have build web app in Yii-2.0.9 and its working very well in local and live. but i want to upload whole code in github repository. all folders/files upload successfully except the vendor folder. i tried many to upload "Vendor" folder on github repository. but i didn't get success on it.

So, have you any idea about that? why is not uploading "Vendor" folder on github repository?

Please help me on this

Thanks


Hi,

The VENDOR directory is automatically downloaded and updated according to the requisitisos the composer file.
-------------------------------------
https://github.com/gugoan
0

#3 User is offline   Dhb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-October 16

Posted 01 November 2016 - 08:36 AM

View PostGustavo Andrade, on 01 November 2016 - 07:45 AM, said:

Hi,

The VENDOR directory is automatically downloaded and updated according to the requisitisos the composer file.


Thanks for reply,

Okay, but VENDOR dir is not automatically download in github repo.. and getting below errors on site causing missing VENDOR dir.

Warning: require(/var/www/html/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 7
Fatal error: require(): Failed opening required '/var/www/html/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/index.php on line 7

Is ther any command to put verndor dir in github repo?

Thanks

0

#4 User is offline   Gustavo Andrade 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 200
  • Joined: 16-August 11
  • Location:Brazil - MG

Posted 01 November 2016 - 11:29 AM

View PostDhb, on 01 November 2016 - 08:36 AM, said:

Thanks for reply,

Okay, but VENDOR dir is not automatically download in github repo.. and getting below errors on site causing missing VENDOR dir.

Warning: require(/var/www/html/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 7
Fatal error: require(): Failed opening required '/var/www/html/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/index.php on line 7

Is ther any command to put verndor dir in github repo?

Thanks



try:

composer update

-------------------------------------
https://github.com/gugoan
0

#5 User is offline   Dhb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-October 16

Posted 01 November 2016 - 11:03 PM

View PostGustavo Andrade, on 01 November 2016 - 11:29 AM, said:

try:

composer update



I already tried that via command prompt in my local repo, but its created vendor folder in local repo. but while pushing all code in repo at that time vendor folder doesn't push on repo.

Could you please tell me, what i missed?

Thanks
0

#6 User is offline   skapeyi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 22-November 13
  • Location:Uganda

Posted 12 November 2016 - 02:48 PM

View PostDhb, on 01 November 2016 - 11:03 PM, said:

I already tried that via command prompt in my local repo, but its created vendor folder in local repo. but while pushing all code in repo at that time vendor folder doesn't push on repo.

Could you please tell me, what i missed?

Thanks

I don't know why you should be pushing the vendor folder to GitHub! You can always have the latest downloaded for you using composer.
However, if you insist, there is a file called .gitignore in the project root. Open that file and comment out the line that has
'/vendor'


Now since you have already committed and the .gitignore was cached, you want to clear the cache and load the new .gitignore. First commit all unsaved changes and then run
git rm -r --cached
to load the new file. After that you should be able to commit your vendor files to Github

Attached File(s)


0

#7 User is offline   Dhb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 17-October 16

Posted 30 November 2016 - 07:19 AM

View Postskapeyi, on 12 November 2016 - 02:48 PM, said:

I don't know why you should be pushing the vendor folder to GitHub! You can always have the latest downloaded for you using composer.
However, if you insist, there is a file called .gitignore in the project root. Open that file and comment out the line that has
'/vendor'


Now since you have already committed and the .gitignore was cached, you want to clear the cache and load the new .gitignore. First commit all unsaved changes and then run
git rm -r --cached
to load the new file. After that you should be able to commit your vendor files to Github


Thanks a lot
0

#8 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,546
  • Joined: 10-October 10
  • Location:Denmark

Posted 30 November 2016 - 09:40 AM

You really don't want to upload the vendor folder to Github.

It takes ages, and is completely pointless. :)

Why do you want to do that?

The vendor folder is in the gitignore for a very good reason: the folder is generated by running Composer.

Do you want to upload the assets and the runtime directories too? No, of course not.

Why do you need/want to add the vendor directory?
"Less noise - more signal"
0

#9 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,546
  • Joined: 10-October 10
  • Location:Denmark

Posted 30 November 2016 - 11:28 AM

To illustrate:

I just cloned my project which has 194 files and 67 subfolders and a weight of 2.5MB.

After running composer, bower and npm, the size has grown to 239.4MB, with 16779 files in 3519 subfolders...

Generated 'things' should never be committed to source control. :)
"Less noise - more signal"
0

#10 User is offline   auzadventure 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 20-August 15
  • Location:Singapore

Posted 20 April 2017 - 10:56 PM

Just answering more in detail.

The 'Vendor' folder consist of 3rd party code put into components. So instead of putting these code in your project you can simply add them to your json file. Think of it as a list of plugins. The reason is that it's just duplicated.

composer update



Once you download the git file, you can run composer update. This tells composers to go get the required plugins by downloading from the list, most likely also on github. It keeps your git filled with only the essential code that is not available elsewhere.
Questions are the Answer.

Wesvault - Premium Economy Software
Yii2 Framework Specialist
http://www.wesvault.com

Singapore
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users