Search code examples
phpyiiversion-controlmercurialhgignore

Which files and directories should I ignore when putting my Yii project under version control?


Using the Yii PHP framework with Mercurial as version control.

Which files and directories should I ignore when putting my Yii webapp project under version control (i.e. what to put in .hgignore)?


Solution

  • One of the examples (for Git, but you can adapt it to Mercurial) recommends to ignore:

    • swp – VIM swap files
    • .buildpath, .project, .settings – files and folders generated by Eclipse
    • .idea – folder generated by JetBrains PhpStorm
    • assets/* – everything under assets are generated by Yii during runtime
    • runtime/* – same goes to everything under runtime, we wouldn’t want to version control them
    • protected/data/*.db – for sqlite users, stop version control sqlite databases
    • protected/tests/report/* – code coverage test report (Just started practising TDD, hence this)