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>.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 email@example.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.