From the course: Learning Composer, the PHP Dependency Manager
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Use Composer with version control
From the course: Learning Composer, the PHP Dependency Manager
Use Composer with version control
- [Narrator] Now that you know how Composer works I want to give you a few tips on how to use it on day to day projects and production. First off let's look at how to use version control on a project that uses Composer. In this example I have created a GitHub repository and I want to run version control through Git and GitHub. Currently the only file committed to the repository is readme.md. The rest of the files as you can see here are unstaged. Now comes the question, which parts of the Composer setup do I want to commit to my project and commit to version control? First of all you should never commit the vendor folder. This folder contains all of your dependencies and their dependencies and it can get huge. More importantly, the Composer.lock and composure.json files are there specifically to allow you to duplicate the project without having to have the vendor folder with its content handy. Before committing anything else, let's create a GitIgnore file for Composer. New file dot…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.