A .gitignore for themes
This page is for designers preparing a theme repository. A .gitignore keeps files that should never be published
out of every commit.
What the design wizard writes
# Editor leftovers
*~
#*#
.#*
*.orig
*.rej
*.bak
*.swp
*.swo
# Operating system
.DS_Store
Thumbs.db
# Build output and dependencies
/vendor/
/node_modules/
*.logWhat to add for a theme
| Add | When |
|---|---|
var/ | Your scripts write caches or logs inside the theme |
share/*.bak*, share/*.backup-* | You back up .dba files next to them (as sevenx_themes_media ignores share/db_data.dba.bak.*) |
/design/*/stylesheets/*.map | You build CSS from sources and do not ship source maps |
.env, *.key, *.pem | Never needed in a theme; ignore them so they cannot be committed by accident |
If you compile stylesheets from Sass or another source, decide whether you commit the result. Installations do not run your build tools, so the compiled CSS normally must be committed.
Step by step: check before every release
git status --short --ignoredshows what is ignored (!!) and what is not.git ls-files | grep -E '\.(bak|orig|log|key|pem)$|/\.env$'prints nothing.- Search tracked files for secrets:
git grep -n -i -E 'password|secret|api[_-]?key|token' -- settings/and read every match. - If something private was committed and pushed, removing it in a new commit does not remove it from the history. Change the secret (it is no longer secret) and ask for help before rewriting a published history.
Related pages
- The secret check before an extension is packaged
- Putting a theme under Git
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.