Most Commonly Used Git Commands

A lot of chatter about using Git and Subversion from the command line versus clients. Folks, take your time and learn the command lines. There’s a lot of stuff you can use the UI clients don’t always wrap into UI. Things like post-commit hooks, etc make the command line way more pure and powerful.

Here’s the same list for Subversion.

But for Git/Github, you can get most of what you need out of git clone, git commit, git push, git pull, git status, git diff and git merge.

Learn these and you won’t know everything about git, but you’ll be most of the way there.

Most Commonly Used Subversion Commands

A lot of chatter about using Git and Subversion from the command line versus clients. Folks, take your time and learn the command lines. There’s a lot of stuff you can use the UI clients don’t always wrap into UI. Things like post-commit hooks, etc make the command line way more pure and powerful.

Here’s the same list for Git/Github.

But for Subversion, you can get most of what you need out of svn co, svn ci, svn commit, svn diff, and svn status.

Learn these and you won’t know everything about svn, but you’ll be most of the way there.

Maintaining WordPress on SVN: Adding Plugins

Thank you for joining me again for this series on maintaing WordPress from subversion. We talked previously about creating an SVN repository and then about importing WordPress into the SVN repository.

Today, we get into customizations. It does us no good to have an SVN repository with WordPress if we don’t change it to be something other than what it is. In this episode I talk about adding plugins (and you can add any file, really) by adding it to the working copy folder and then checking it in.

I also touched quickly on svn:externals, although I note that I goofed in the screencast and typed

1
svn propedit svn:external .

instead of using the correct

1
svn propedit svn:externals .

(note the plural externals).

Maintaining WordPress on SVN: Create Your Repository

A lot of people know that I’ve done a bit with maintenance of WordPress using subversion. Alot of those same people have asked me to show how it’s done. It’s not very difficult, really, but I encourage you to work with a host like Dreamhost that provides one click installs of svn. It’s the easiest way to get web accessible repositories to use for maintenance of all your various WordPress blog.

Here’s video 1 in this series, which demonstrates the creation of an SVN repository and the basic file structure that is best practice for a repository.

WordPress WXR Class

One of the most frustrating things to me in my years of working with WordPress and b5media has been migrating blogs into WordPress. Every blog platform does things differently and although WordPress has import support for a large number of blog platforms, it always seems like I get the job of migrating from platforms that don’t have any way of exporting posts to take to a different platform, such as WordPress.

I’ve done a number of these migrations now – Nucleus, Drupal, Serendipity and others. The latest was Expression Engine – needed to move Shai’s blog over to WordPress. This was the catalyst I needed to write a base class for the WordPress import/export format known as WXR, or WordPress eXtended RSS.

For casual users, this is not for you. For developers, this may be a life saver for you.

The class can be downloaded via SVN:

1
svn co http://svn.aaronbrazell.com/wpwxr/trunk wpwxr

Included in this repository is the base

1
class.wxr.php

class along with sample code to build your own apps from.

Reference: Complete WordPress WXR Base Class documentation is online.

Instantiation: This is a base class. Therefore, you should never extantiate it directly – only via another class via extending.


1
2
3
4
5
6
7
class myNewClass extends WXR_export {

    function myfunction()
    {
        echo "Hello World!";
    }
}

Debug mode: If you wish to use debug mode, you can set the

1
$debug

property of the class to true. The default is false. If debug mode is on, output will be sent to the screen as opposed the the WXR file.

Example:


1
2
$n = new myNewClass;
$n->debug = true;

Export Filename: By default, the name of the WXR file is date based (e.g wxr-2008-01-26.xml). You can change this by changing the

1
$export_filename

property.


1
2
$w = new myNewClass();
$w->export_filename = 'file-movabletype.xml';

I’d love to get patches if you want to contribute. You should send them to emmensetech [at] gmail [dot] com. In addition, if you use this and create extension classes, I’m more than happy to host them. I’ll be seeding the pot with the Expression Engine class I used this weekend.

Exporters Built