MyBB Community Forums

Full Version: .gitignore file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
 
Just a suggestion to add a basic .gitignore file to the MyBB git repo, will make it easier to use the git repo for automated deploys/development (a la Docker), and prevent accidental commits like this Wink.

It'd just place ignores on files that are automatically changed by MyBB itself (cache, uploads, settings etc.). Files that are ignored don't get deleted and can be forcefully added to commits git add -f ignored.file (If, say, the default config file needs to be changed).

Here is a tidied up one that I use for my site, I think it includes most base MyBB stuff, I'd really like to see something like it included in the base repo.

# Config Files
inc/config.php
inc/config.default.php
inc/settings.php


# Cache Directory
cache/*

# Uploads
uploads/*

#Misc
install/lock
error.log
.htaccess

# Generic OS stuff
Thumbs.db
.DS_Store
*~
I don't see why not.
+1 for this.
Don't include inc/config.default.php in the ignored list, though. This file is used for adding new settings when upgrading to a new version.
config.default.php is always empty and never used Wink
It gets renamed during install to config.php: https://github.com/mybb/mybb/blob/c243e6....php#L1030
Yeah, it's renamed but it isn't used for anything related to settings.
Oh right, when I wrote the OP I just assumed it contained a base/template config. I'd still leave it in the ignore file because it'll generate tracked changes following the install, although the fact that it never changes will mean there shouldn't be any conflicts later down the line.
$configwritable is not defined for L#1032 lol

Anyways, why not.