Git with Subversion for WordPress Plugin Development Detailed Guide

Download PDF

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 :

 

Now get the last revision number by using this command :

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 :

Now run this command :

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 :

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 :

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

Now, create a new GitHub repository with the same name (for making the things easy) from browser, i.e. web UI. There is video in the linked guide.
You will ultimately land in a webpage in GitHub saying “Create a new repository on the command line” and the commands :

Git with Subversion for WordPress Plugin Development Detailed 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:

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 :

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

0saves

Here’s what we’ve got for you which might like :

Also, we have YouTube Videos and Apple iTunes Podcast Channel (the link will open iTunes App on Mac).

Additionally, performing a search on this website can help you.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Google+ or Twitter to join the conversation right now!

If you want to Advertise on our Article or want Business Partnership, you are invited to Contact us.

Contact Us