Installing WordPress The Right Way
svn co http://svn.automattic.com/wordpress/tags/[current_tag_number] [name_of_site]
cd [name_of_site]
touch .htaccess
chmod 666 .htaccess
cp wp-config-sample.php wp-config.php
cd wp-content/themes/
cp -R default [name_of_theme]
cd [name_of_theme]
rm -rf `find . -type d -name .svn`
Now import the content of wp-content/themes/[name_of_theme] into your choice of source code management systems and get to it.
Updating
cd [name_of_site]
svn sw http://svn.automattic.com/wordpress/tags/[new_tag_number]
Sources
Using Someone Else’s SVN Repository with Git
If you have a repository URL that looks like this:
http://code.yourmom.com/project/trunk/
Issue this command (note that you leave off trunk/):
git svn clone -s http://code.yourmom.com/project/ project
After it’s done, see how big it is:
du -hs project
And you’ll see something like this:
20M project/
If it’s particularly big, go into the folder and garbage collect:
cd project
git gc
From within the project folder, set your local repository to the trunk (it’s set to whatever branch had the last commit otherwise):
git reset --hard trunk
Create your own branch and get to work:
git co -b treys_changes
When you want to pull in the changes from the original author to stay up to date:
git svn rebase
If you’ve cloned this repo (after posting it to GitHub or elsewhere) and want to use it on another computer, you’ll have to use do more step in order to track the original SVN repo again:
git update-ref refs/remotes/trunk origin/master
git svn init -T trunk http://code.yourmom.com/project/
Sources
- Brian Rosner’s Using git with Django Screencast
- Pieter on #github
- WebKit wiki (via Pieter)
Setting up a new Rails project in Subversion
Create a folder to put all the junk you need to set things up.
mkdir svn_setup
cd svn_setup
Create the standard SVN folder structure.
mkdir tags
mkdir branches
Create a new Rails project and rename it to be the trunk folder.
rails project_name
mv project_name trunk
The reason to do this is so your database.yml file (among others) will have the right project name instead of trunk_development, etc.
A little housekeeping before putting the files into the repository.
cd trunk
rm -r tmp/*
rm -r log/*
mv config/database.yml config/database_example.yml
Put the files into the repository.
cd ..
svn import . svn_project_url -m "initial import of blank Rails project" --username whathaveyou
Checkout the files and tell Subversion to ignore some files.
cd ..
svn co svn_project_url/trunk project_name
cd project_name
cp config/database_example.yml config/database.yml
svn propset svn:ignore database.yml config/
svn propset svn:ignore "*" log/
svn propset svn:ignore "*" tmp/
If you want, setup Rails with svn:externals to that it will be ready for you to lock it into a particular version for stability.
svn propedit svn:externals vendor/
In the file that pops up, enter this (or enter whatever version you want to use–such as http://dev.rubyonrails.org/svn/rails/trunk/ for edge):
rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-3/
Save then close the file.
Check the changes back into the repository.
svn ci -m "Ignore database.yml, log/, and temp/. Set up Rails with svn:extnrnals"
Then update your checkout to get the Rails external to load.
svn up
Other things:
When you’re done with everything you can delete the svn_setup folder. I think I’m going to keep mine around for a slight head start on more projects.
Don’t forget to use the -c option when you run script/generate to automatically add the files to Subversion.
script/generate scaffold_resource angryfarmer name:string bales_of_hay:integer -c
When installing plugins, use the -x option to make it an svn:external
script/plugin install -x robot_cow
Source
Using Subversion to upgrade WordPress
- Use svn:externals to install WordPress plugins
- How to use SVN to update WordPress
- Subversioning WordPress Upgrades
Update (November 1, 2006): It really works. I’ve got all 3 of my blogs (one two three) now set up on SVN. The next step will to be when I add my customized themes to Subversion so all I ever have to do is go to the command line to do anything. No (s)FTP or anything. I imagine this will make switching servers really easy now.
Update (January 23, 2007): To upgrade to WordPress 2.1:
- Disable all plugins (take a screenshot first)
- Run this command:
svn switch http://svn.automattic.com/wordpress/branches/2.1/
- Go to your admin screen and update the database when prompted.
- Enable your plugins again.
Update (May 22, 2007): Just upgraded to version 2.2