Last active
August 29, 2015 14:10
-
-
Save shulard/75c45260591ce0401b3e to your computer and use it in GitHub Desktop.
24 jours de web: Comment bien versionner mon site WordPress avec Git et Github
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Installation Wordpress | |
/wp-cms/* | |
#Contenus non versionnés | |
/wp-content/uploads/ | |
/wp-content/plugins/ | |
#Configuration | |
/wp-config.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase "/" | |
#If the URL start with public stop redirect | |
RewriteRule wp\-cms\/index\.php$ - [L] | |
#If you request an URL it does not start with wp-cms | |
#Else the HTACCESS have done the redirect | |
#you can go to the index.php to execute code | |
RewriteCond %{REQUEST_URI} ^/wp-cms | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /wp-cms/index.php [L] | |
#wp-cms is not here so we add it :) | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /wp-cms/$1 [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git submodule add https://github.com/wordpress/wordpress wp-cms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Tells WordPress to load the WordPress theme and output it. | |
* @var bool | |
*/ | |
define('WP_USE_THEMES', true); | |
/** Loads the WordPress Environment and Template */ | |
require(dirname(__FILE__).'/wp-cms/wp-blog-header.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Accès au répertoire qui va contenir le projet | |
cd /chemin/vers/mon | |
#Création du projet et initialisation | |
mkdir depot | |
cd depot | |
git init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout git://yourhost/yourproject.git preprod | |
cd preprod | |
phing -Dbuild.env=PREPROD env:init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd wp-cms | |
#Récupération de la dernière liste de tags | |
#(nécessaire pour accéder aux tags créés depuis la mise en place du projet) | |
git fetch --tags | |
git checkout 4.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//wp-content se trouve dans le même répertoire que wp-config.php | |
//Pour une compatibilité PHP5.2, je n'utilise pas __DIR__ | |
define('WP_CONTENT_DIR', dirname(__FILE__).'/wp-content'); | |
//L'URL doit être absolue vers le répertoire wp-content | |
define('WP_CONTENT_URL', 'http://domain/path/to/wp-content'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment