#tools #import #branch #folder #tool #github-pages

bin+lib ghp

Import a folder to gh-pages branch easily!

3 releases

Uses old Rust 2015

0.1.2 May 11, 2016
0.1.1 Apr 24, 2016
0.1.0 Apr 24, 2016
Download history 97/week @ 2022-11-30 17/week @ 2022-12-07 3/week @ 2022-12-14 5/week @ 2022-12-21 89/week @ 2022-12-28 1/week @ 2023-01-04 16/week @ 2023-01-11 5/week @ 2023-01-18 9/week @ 2023-01-25 43/week @ 2023-02-01 18/week @ 2023-02-08 20/week @ 2023-02-15 59/week @ 2023-02-22 35/week @ 2023-03-01 15/week @ 2023-03-08 4/week @ 2023-03-15

117 downloads per month


270 lines

ghp-rs Crates.io Travis Status Build status apache-license mit-license

Easily import a folder to your gh-pages branch!


I wrote this tool to help people who want to host documentation or anything on a gh-pages branch. This was heavily influenced by ghp-import and has a similar implementation.


The documentation can be found here. The documentation is powered by cargo doc and ghp-rs. Check out the .travis.yml and the travis setup for an example of how to use ghp-rs with rustdoc.


Via Cargo

cargo install ghp

Via Binary

Coming Soon!

Via Git

git clone https://github.com/LucioFranco/ghp-rs
cargo build --release
export PATH="$PATH:/path/to/ghp-rs/target/release/"

Command Line Usage


# Example

ghp build # move content of build folder to gh-pages branch

ghp --branch website build # will move the contents of the build folder to the website branch

ghp --message "This is a git commit message" build

Programatic Usage


ghp = "0.1"
extern crate ghp;
use ghp::import_dir;

import_dir("build", "gh-pages", "commit message").unwrap();

Travis Setup

For this you will need to have a GH_TOKEN variable with your github personal token. Read more here.

after_success: |
  [ $TRAVIS_RUST_VERSION = stable ] &&
  [ $TRAVIS_BRANCH = master ] &&
  [ $TRAVIS_PULL_REQUEST = false ] &&  
  ghp target/doc &&
  git config user.name "Travis Documentation" &&
  git config user.email "name@example.com" &&
  git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages


Licensed under either of


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.