
Git is a distributed version control system
with an emphasis on speed.
Created by Linus Torvalds (see: Linux)
# Exclude these files from the git repo
wp-content/upgrade/*
wp-content/uploads/*
sitemap.*
wp-config.php (optional)
# ...wp-content/backup, wp-content/cache, etc.
# Hidden system files
*.DS_Store
*[Tt]humbs.db
*.Trashes
# Include these files in previously blocked directories
!wp-content/uploads/.htaccess
// ============================
// = Custom Environment Setup =
// ============================
$environments = array(
'local' => 'mysite.local',
'development' => 'dev.mycoolsite.com',
'production' => 'www.mycoolsite.com
);
$server_name = $_SERVER['SERVER_NAME'];
foreach($environments AS $key => $env){
if(strstr($server_name, $env)){
define('ENVIRONMENT', $key);
break;
}
}
// If no environment is set default to production
if(!defined('ENVIRONMENT')) define('ENVIRONMENT', 'development');
switch(ENVIRONMENT){
case 'local':
define('DB_NAME', 'myCoolSite');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('DB_HOST', 'localhost');
define('WP_DEBUG', true);
$table_prefix = 'wp_';
break;
case 'development':
....
break;
case 'production':
....
break;
}
# Exclude these files from the git repo
wp-content/upgrade/*
wp-content/uploads/*
sitemap.*
wp-config.php (optional)
# ...wp-content/backup, wp-content/cache, etc.
# Hidden system files
*.DS_Store
*[Tt]humbs.db
*.Trashes
# Include these files in previously blocked directories
!wp-content/uploads/.htaccess
Reduces size of repo