Laravel and SVN

Laravel assumes you're using GIT to handle version control. Here is a guideline to fix it for SVN.

In short: just add all the files and directories named  in the .gitignore files to the SVN ignore list.

Add the contents of the following directories to the ignore list (so the directories will be in version control, but the contents not):

  • /vendor
  • /storage
  • /storage/app
  • /storage/app/public
  • /storage/framework
  • /storage/framework/cache
  • /storage/framework/sessions
  • /storage/framework/views
  • /storage/logs
  • bootstrap/cache

The SVN command to ignore the contents of the vendor directory has to be executed inside the /vendor directory:

svn propedit svn:ignore .

And then type:


And save.

I also move the vendor directory outside the htdocs root and create a symbolic link to it. I do this because the whole htdocs content is replaced on the production server on each release, so now I don't need to do a composer install after each release if I know I have not updated any packages.

Also add the .env file in the root .gitignore file.

Maybe you bumb into the limitation that you can only add something to the SVN ignore list after the directory itself is version controlled. You can first add and commit it, and then remove it, but this takes time. See a nice alternative.

Regarding the composer file: commit both the .json and .lock file. See a good explanation on why this is.

See also my other post about environment and the environment specific settings.

Tag: , | Category: