.gitignore for CakePHP
18 ignore rules for CakePHP, ready to copy into your repository.
PHP web framework
The complete .gitignore for CakePHP
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:27:29 UTC
# Technologies: CakePHP
### CakePHP ###
/vendor/*
/config/app.php
/tmp/cache/models/*
!/tmp/cache/models/empty
/tmp/cache/persistent/*
!/tmp/cache/persistent/empty
/tmp/cache/views/*
!/tmp/cache/views/empty
/tmp/sessions/*
!/tmp/sessions/empty
/tmp/tests/*
!/tmp/tests/empty
/logs/*
!/logs/empty
/app/tmp/*
/app/Config/core.php
/app/Config/database.php
/vendors/*
What these CakePHP rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
CakePHP 3
| Pattern | What it ignores |
|---|---|
/vendor/* |
CakePHP 3 |
/config/app.php |
CakePHP 3 |
/tmp/cache/models/* |
CakePHP 3 |
!/tmp/cache/models/empty |
CakePHP 3 |
/tmp/cache/persistent/* |
CakePHP 3 |
!/tmp/cache/persistent/empty |
CakePHP 3 |
/tmp/cache/views/* |
CakePHP 3 |
!/tmp/cache/views/empty |
CakePHP 3 |
/tmp/sessions/* |
CakePHP 3 |
!/tmp/sessions/empty |
CakePHP 3 |
/tmp/tests/* |
CakePHP 3 |
!/tmp/tests/empty |
CakePHP 3 |
/logs/* |
CakePHP 3 |
!/logs/empty |
CakePHP 3 |
CakePHP 2
| Pattern | What it ignores |
|---|---|
/app/tmp/* |
CakePHP 2 |
/app/Config/core.php |
CakePHP 2 |
/app/Config/database.php |
CakePHP 2 |
/vendors/* |
CakePHP 2 |
How to use this .gitignore for CakePHP
- Copy the CakePHP rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.