--- layout: page title: "Deploying to Github Pages" date: 2011-09-10 17:52 sidebar: false footer: false --- To setup deployment, you'll want to clone your target repository into the `_deploy` directory in your Octopress project. If you're using Github user or organization pages, clone the repository `git@github.com:username/username.github.com.git`. ### With Github User/Organization pages ``` sh git clone git@github.com:username/username.github.com _deploy rake config_deploy[master] ``` ### With Github Project pages (gh-pages) ``` sh git clone git@github.com:username/project.git _deploy rake config_deploy[gh-pages] ``` The `config_deploy` rake task takes a branch name as an argument and creates a [new empty branch](http://book.git-scm.com/5_creating_new_empty_branches.html), and adds an initial commit. This also sets `deploy_default = "push"` in your `_config.yml` and prepares your branch for easy deployment. The `rake deploy` task copies the generated blog from the `public` directory to the `_deploy` directory, adds new files, removes old files, sets a commit message, and pushes to Github. Github will queue your site for publishing (which usually occurs instantly or within minutes if it's your first commit). Now you should be set up to deploy, just run ``` sh rake generate # If you haven't generated your blog yet rake deploy # Pushes your generated blog to Github ```