CodeIgniter 的 .gitignore

适用于 CodeIgniter 的 15 条忽略规则,可直接复制到您的仓库。

PHP 网络框架

CodeIgniter 的完整 .gitignore

# 由 LFGitignore - https://lfgitignore.com 生成
# 创建:2026-10-31 21:49:58 UTC
# 技术:CodeIgniter

### CodeIgniter ###
*/config/development
*/logs/log-*.php
!*/logs/index.html
*/cache/*
!system/cache/*
!*/cache/index.html
!*/cache/.htaccess
user_guide_src/build/*
user_guide_src/cilexer/build/*
user_guide_src/cilexer/dist/*
user_guide_src/cilexer/pycilexer.egg-info/*
application/logs/*
!application/logs/index.html
!application/logs/.htaccess
/vendor/

这些 CodeIgniter 规则实际上忽略了什么

以下列出了每个忽略模式及其加入 .gitignore 的原因。

通用

模式 忽略的内容
*/config/development 通用
*/logs/log-*.php 通用
!*/logs/index.html 通用
*/cache/* 通用
!system/cache/* 通用
!*/cache/index.html 通用
!*/cache/.htaccess 通用
user_guide_src/build/* 通用
user_guide_src/cilexer/build/* 通用
user_guide_src/cilexer/dist/* 通用
user_guide_src/cilexer/pycilexer.egg-info/* 通用
application/logs/* CodeIgniter 3 相关文件
!application/logs/index.html 通用
!application/logs/.htaccess 通用
/vendor/ 通用

如何将此 .gitignore 用于 CodeIgniter

  1. 复制上面的CodeIgniter规则,或者直接下载文件。
  2. 在 Git 仓库根目录创建名为 .gitignore 的文件,并将规则粘贴进去。
  3. 如果其中一些文件已被跟踪,请运行 git rm -r --cached . 然后再次提交 - Git 仅将忽略规则应用于未跟踪的文件。
  4. 提交 .gitignore 以便团队中的每个人都共享相同的规则。

其他 框架 .gitignore 模板

查看每个 框架 模板