Skip to content

Instantly share code, notes, and snippets.

@bookwyrm
Last active August 29, 2015 14:23
Show Gist options
  • Save bookwyrm/2b8b123f1a7079c250cc to your computer and use it in GitHub Desktop.
Save bookwyrm/2b8b123f1a7079c250cc to your computer and use it in GitHub Desktop.
Walkthrough: Setting up a Secure WordPress Site with Git
cd wp-content/plugins/
rm hello.php
cd ../themes/
rm -fR twentyten twentyeleven twentytwelve twentythirteen twentyfourteen
cd ../../
git commit -am 'Deleting unused themes and plugins'
cp wordpress/wp-config-sample.php wp-config.php
cp wordpress/index.php .
touch environment.php
touch .gitignore
git add index.php wp-config.php .gitignore
git commit -m 'Placeholder configuration'
cp -R wordpress/wp-content .
git add wp-content
git commit -m 'Manage themes and plugins outside of submodule'
mkdir secure-wordpress-walkthrough
cd secure-wordpress-walkthrough
git init
git submodule add git://github.com/WordPress/WordPress.git wordpress
git commit -m 'Add WordPress submodule'
cd wordpress
git tag # list tags
git checkout 4.2.2 # checkout latest version
cd ..
git add wordpress # stage updates
git commit -m 'Checkout latest WordPress version'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment