Which files/directories to ignore in a Laravel 4 project when using version control?

I have a Laravel 4 project, and I would like to know which files should be ignored when using a version control software such as Git, Mercury or SVN?

The structure of my project looks like the following screen capture.

  • Syncing local laravel project with existing git repository
  • How to add private github repository as Composer dependency
  • Installing laravel on existing project
  • Laravel4 Composer update failing
  • What to include in gitignore for a Laravel and PHPStorm project?
  • Laravel - Artisan not working
  • enter image description here

    I’m pretty new to Composer so I’m not very clear about what goes to a repo what not. If someone can post their .gitignore file or their SVN ignore property, it could be handy.

  • Converting a repository from git to subversion
  • How does one split a branch from master
  • Git error: Unable to negotiate with XX.XX.XXX.XXX : no matching host key type found . their offer: ssh-dss
  • Should I version control the minified versions of my jQuery plugins?
  • Completely remove every trace of git commit
  • How to delete a repository and add a new one in Android studio?
  • 5 Solutions collect form web for “Which files/directories to ignore in a Laravel 4 project when using version control?”

    For reference, that .gitignore file can be found here:

    /bootstrap/compiled.php
    /vendor
    composer.phar
    composer.lock  # Remove this one after you create a project
    .env.*.php
    .env.php
    .DS_Store
    Thumbs.db
    

    As noted in the below comment, you probably want to commit composer.lock in your project. Laravel ignores it by default so the authors of the laravel/laravel package don’t accidently impose packages on you.

    Your project should include the composer.lock file so you can install packages of stable versions (via composer install instead of composer update) properly in your production environments.

    Note that the config file:

    app/config/app.php
    

    Has a cryptographic key in it that wouldn’t be great to commit to a repository. Or, at least, the file needs to be overwritten in production.

    You might also want to see the Laravel docs here and here. This discusses how to setup different Laravel configurations for different environments and protect sensitive information. All your .env.local.php type files should not be included in version control. Note that the .env.*.php and .env.php is added in the default Laravel .gitignore file. You can see it here

    Laravel has posted their .gitignore on GitHub, which can be found here.

    As of today, it looks like this:

    /bootstrap/compiled.php
    /vendor
    composer.phar
    composer.lock
    .env.*.php
    .env.php
    .DS_Store
    Thumbs.db
    

    GitHub has a repository of suggested .gitignore files for almost all kinds of projects at: http://github.com/github/gitignore

    Alternatively, you can search it for your project using this handy and extremely useful online tool: http://www.gitignore.io

    Git Baby is a git and github fan, let's start git clone.