Nipun Tyagi
Nipun Tyagi

Reputation: 898

Laravel 5 setup git repo for multiple developers

I've done lot of Google but still looking for solution, I'm working on Laravel5 project & wants to set it up with GitHub so multiple developer can work on it.

I've install Laravel & place in a repository on Git, Now I cloned it on my local machine & another developer also clone that repository in his machine and start working.

But issue is that, I have installed a package for HTML forms in my machine by composer & push my code to github. But when another developer pull the repository then his code is break because composer.js is updated for that package but actually that HTML package is not exists on his machine.

Can anyone help me to short out this, or is there any way so we ignore vendor folder, composer.js, app.php etc files during git Push?

Upvotes: 0

Views: 700

Answers (1)

James
James

Reputation: 16339

To answer your question specifically, yes you could choose to ignore the vendor folder, composer.json and app.php files when you push to git. To do this, you would simply need to update your .gitignore file to reflect this. I.e, include these in your .gitignore:

  • /vendor
  • composer.json
  • /config/app.php

But then the next question is whether you really want to do this, as doing so would mean that changes you make - and any subsequent pushes - may not be compatible with work the other developer is doing down the track.

If you exclude the /vendor file and the /config/app.php file but leave the composer.json file in there now that the other developer already has a copy of the core files, the updated composer.json file they download would allow them to use composer install to update the project with the new package.

However all of this would be problematic for a developer who joins you down the track and doesn't have any of the current files.

Upvotes: 3

Related Questions