Git with Subversion for WordPress Plugin Development Detailed Guide

Advertisement

Git with Subversion for WordPress Plugin Development Detailed Guide Explains How To Use Git like GitHub, your Mac and WordPress to Keep Plugins Updated. This is Fully Command Line Based Guide. We are using OS X 10.9.1 while writing this guide. Git with Subversion for WordPress Plugin Development Detailed Guide is quite important as this keeps our development in three places – your Mac, Git like GitHub (or your own server with Git). Usually we only use local computer as backup copy for ongoing development, but adding Git in the middle has the basic advantage of having another copy at hand on the server. It was great if WordPress directly used Git, but till date, SVN is used.

Git with Subversion for WordPress Plugin Development : Needed Stuffs

It is impossible to go with the basic details – it will make this guide too lengthy. Just to say what we are using for this Git with Subversion for WordPress Plugin Development Detailed Guide. We are using HomeBrew Package manager with iTerm2. (You can see the setup here). Practically things has not been changed since Mark Jaquith wrote the guide – Developing on WordPress using Git. git svn <argument> itself a command. You just need to update and upgrade HomeBrew, install SVN and Git via HomeBrew – they will normally rightly work on OS X Mavericks. Te error with git svn rebase which disturbed before has been fixed by HomeBrew now.

Git with Subversion for WordPress Plugin Development : The Whole Thing

It is quite pathetic to work with SVN on Mac than Git. We are assuming that you have a WordPress Plugin and a GitHub Account. Normally, we are always on our user named folder on Terminal/iTerm2, so we will create a directory first – named like wp-plugins or something. This is to keep the future Plugin developments easier.

So, create the folder :

Vim

1

mkdir wp-plugins

Now get the last revision number by using this command :

Vim

1

svn log http://plugins.svn.wordpress.org/ftp-to-zip/

ftp-to-zip is our Plugin’s name, you must replace with your own Plugin’s name. You will get output and lot of numbers with your commit comments. Get the last one and run this command :

Change the r583286 and ftp-to-zip with your own data. You will get terminal output like “Initialized empty Git repository in…”. Great. Change directory to the folder now :

Vim

1

cd ftp-to-zip

Now run this command :

Vim

1

GIT_TRACE=2git svn fetch

There will be huge terminal output running for long time! You need not not read them! It will stop, for example at 583286 in our case. We need to move the SVN HEAD into our Git master :

Vim

1

git svn rebase

All files will appear on your local computer, that is Mac now. You can open the location using Finder. We tell this cheatsheet everytime working with any kind of Git. Basically this is a sort of cheating – we can change the things from GUI.

Now, in case of any wrong things with SVN, in case you added any SVN url wrong, you can fix it by removal :

Vim

1

git config--remove-section svn-remote.svn

This command is only for correcting mistake – not a part of this guide.

Normally, your needed commands will be there, there is nothing to think with these lines of commands here. Now, actually we will change some files and normally push it to GitHub, with usual Git Commands like:

Vim

1

git commit-am"Vomiting like a blind, Everything sucks, really"

You can merge, you can do anything you want towards Github – its working in the middle. Copy-pasting readme.txt to README.md will work fine for the easy to read part. Now to commit the changes towards WordPress, you need two commands :

Vim

1

2

git svn rebase

git svn dcommit

If git svn rebase command does not work, try (in excerpt format, in this way) :

Fix WordPress RSS feed not updating problem by following this logical guide. The problem can arise from various points and only a logical checkup will work. Normally all of us uses Google Feedburner Service and some kind of redirection towards the Feedburner’s URL – either via Plugin, Theme or .htaccess rules. The situation is complicated […]