How to make GitHub host your PEAR channel

GitHub does probably not need an introduction, but their “user pages” might.

Each user on GitHub can have their own pages by creating a repository called <user>.github.com. These pages will be accessible via, yup, you guessed it: http://<user&gt;.github.com. My username is christeredvartsen, so my GitHub pages are located over at christeredvartsen.github.com.

You can read all about these pages over at pages.github.com.

Last year I wrote a post on how to set up your own PEAR channel using Pirum, and now we can use this together with the GitHub pages to have GitHub host our channel.

First, create an empty directory on your machine and initialize a git repository:

mkdir <user>.github.com
cd <user>.github.com
git init

Now you need to add a pirum.xml file in the directory you just created so you can build your channel. The pirum.xml file for my own channel looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<server>
  <name>pear.starzinger.net</name>
  <summary>Starzinger PEAR channel</summary>
  <alias>stz</alias>
  <url>http://pear.starzinger.net/</url>
</server>

Create the file with your favorite editor and change the values so they fit your own channel, save it, then run the following commands inside your newly created directory:

pirum build .
git add --all
git commit -a -m "Initial build"

Now you can head over to GitHub to create your repository. Once you have done that, enter the following commands in your terminal (in the directory you just created):

git remote add origin git@github.com:<user>/<user>.github.com.git
git push origin master

Now your (empty) channel has been pushed to GitHub, and you can browse it at your user page. Next step is to add some PEAR packages to your channel, re-build, then simply run:

git add --all
git commit -a -m "Added some package"
git push

in the directory where your channel files are located. That’s that, easy as pie!

You can also use a different domain name for your user pages if you want to. Read more about that feature over at GitHub.

Oh, and if you haven’t already you might want to beef up your billing plan from Free to something more awesome. I for one think GitHub is totally worth it.

Advertisements
This entry was posted in PHP, Technology and tagged , , , , . Bookmark the permalink.

One Response to How to make GitHub host your PEAR channel

  1. Alberto says:

    Greetings from Colorado! I’m bored to death at work so I
    decided to check out your site on my iphone during
    lunch break. I really like the info you provide here and can’t
    wait to take a look when I get home. I’m shocked at how fast your blog loaded on my cell phone ..
    I’m not even using WIFI, just 3G .. Anyhow, fantastic site!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s