About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconghp-import Publisher's description

Copy your docs directly to the gh-pages branch

As part of gunicorn, me and Benoit Chesneau have been starting to look at how to host documentation. There's the obvious method of using GitHub's post-update hooks to trigger doc builds and rsync to a webserver, but we ended up wanting to try out github's hosting to make the whole interface a bit more robust.

GitHub Pages is a pretty awesome service that GitHub provides for hosting project documentation. The only thing is that it requires a gh-pages branch that is the site's document root. This means that keeping documentation sources in the branch with code is a bit difficult. And it really turns into a head scratcher for things like Sphinx that want to access documentation sources and code sources at the same time.

Developer comments

Then I stumbled across an interesting looking package called github-tools that looked almost like what I wanted. It was a tad complicated and more involved than I wanted but it gave me an idear. Why not just write a script that can copy a directory to the gh-pages branch of the repository. This saves me from even having to think about the branch and everything becomes magical.

This is why ghp-import was created.

Big Fat Warning

This will DESTROY your gh-pages branch. If you love it, you'll want to take backups before playing with this. This script assumes that gh-pages is 100% derivative. You should never edit files in your gh-pages branch by hand if you're using this script because you will lose your work.


Usage: ghp-import [OPTIONS] DIRECTORY

-m MESG The commit message to use on the gh-pages branch.
-p Push the branch to origin/gh-pages after committing.
-r REMOTE The name of the remote to push to. [origin]
-h, --help show this help message and exit

Its pretty simple. Inside your repository just run ghp-import $DOCS_DIR where $DOCS_DIR is the path to the built documentation. This will write a commit to your gh-pages branch with the current documents in it.

If you specify -p it will also attempt to push the gh-pages branch to GitHub. By default it'll just run git push origin gh-pages. You can specify a different remote using the -r flag.


System Requirements:

Program Release Status:
Program Install Support: Install and Uninstall

ghp-import Tags:

Click on a tag to find related softwares

Is ghp-import your software?

Manage your software

Most Popular

linux default icon JOrg 0.93 RC
It's a software to help you control your files and their location.
linux default icon Android HTC 2.3
Android ported to the HTC Vogue, Kaiser, Polaris, and Nike.
linux default icon iReport Designer for JasperReports 4.0.2
iReport is the free, open source report designer for JasperReports.
linux default icon jGRASP 1.8.8_07 Beta
jGRASP is a lightweight development environment,.....
linux default icon Code::Blocks 10.05
A C/C++ IDE built with configurability and extensibility in mind

Related Category

» Archiving (73)
» Benchmarking (88)
» Other (3482)
» Printer (63)
» Shell Tools (113)