The .gitignore file included with the Wireframe boilerplate site profile is based on the general-purpose web project .gitignore file provided by the Bare Minimum Git project. When you start developing a site with the Wireframe boilerplate site profile, you should always make sure that this file suits your workflow – and modify it as necessary.
Purpose
Default .gitignore file serves two primary purposes: it keeps clutter out of your version control system, and – more importantly – it helps avoid slipping secrets into the VCS. Storing sensitive data (passwords, keys, etc.) in a VCS is considered a bad practice, and should be avoided.
Important considerations
Important considerations regarding the .gitignore file:
- ProcessWire modules directory is ignored by default. Wireframe boilerplate expectes module files to be bundled using Composer, but you can also add specific module folders manually, or commment this rule out in .gitignore.
- ProcessWire assets directory is ignored.
- ProcessWire development config file (config-dev.php) and often used PHP environment variable file env.php are both ignored.
- Files starting with a dot (.), a hash/pound character (#), or a tilde (~) are ignored.
- Various types of temporary files, SQL databases and dumps, and packaged files are ignored. This includes any file with a .backup, .bak, .old, .tmp, or .temp suffix.
- Composer, Node, Grunt, and Bower default install directories are ignored.
Installing modules without Composer
Since the /site/modules/ directory is by default included in the .gitignore file ignore rules, files added beneath it won't show up if you add them and type git status
in the site directory. This is by design, since the Wireframe boilerplate expects modules to be installed with Composer. That being said, installing modules without Composer and adding them to your version control system is still easy:
- Download or clone the module files into your /site/modules/ directory.
- From your site directory, run
git add -f modules/[module-folder]
.- Note that the
-f
flag is very important – if you omit it, Git won't allow you to add content into an ignored folder!
- Note that the
- Commit your newly added files to Git with
git commit modules/[module-folder]
.
Another way, obviously, would be to comment out or remove the line in the .gitignore file affecting the modules directory. If you really want to add all your module files and directories to Git, this is a perfectly fine thing to do. And finally, you can also manually add individual module folders into the "whitelisted files" section of your .gitignore file.
Whitelisted files
At the end of the .gitignore file you'll find a section for whitelisted files. If your site requires some one-off deviations from the base rules, the easy (and safe) way out would be including more rules here instead of removing earlier ignore rules.