简体   繁体   中英

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 (ie what to put in .hgignore)?

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)

Here is the default for Yii from github , its not for mercurial but you can port it. also there are for other frameworks and IDE's

Synthesis and generalization of the previous answers (without exact file-lists, but common principles)

For any Tool and any SCM widely-accepted rule is "Don't store working artifacts in repo, store minimal set of objects, which allow you to continue your work on any new place"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM