Octopress/Octopress with Github Project Pages/Attic: Difference between revisions
From charlesreid1
(Created page with "Every project can also create a collection of hosted GitHub pages. To do this, you can create a branch called <code>gh-pages</code> that will be completely separate from your oth...") |
No edit summary |
||
| Line 1: | Line 1: | ||
Every project can also create a collection of hosted GitHub pages. To do this, you can create a branch called <code>gh-pages</code> that will be completely separate from your other branches and will contain all of the content served by the web server when you go to the page <code>http://username.github.io/project</code> | Every project can also create a collection of hosted GitHub pages. To do this, you can create a branch called <code>gh-pages</code> that will be completely separate from your other branches and will contain all of the content served by the web server when you go to the page <code>http://username.github.io/project</code> | ||
=The Procedure= | |||
==Create Local Copy of Project== | |||
First thing you'll need to do is clone your project from Github: | |||
<pre> | |||
git clone https://github.com/charlesreid1/project | |||
</pre> | |||
==Checkout Web Content Branch== | |||
Now, web content is served from a special branch in the Github repository, the <code>gh-pages</code> branch. Everything in that branch is hosted by Github pages web servers. | |||
You have a few different options for creating this branch. If you wanted to create and host a couple of pages of your own content, you could manually create a <code>gh-pages</code> branch, as detailed in [https://help.github.com/articles/creating-project-pages-manually this guide]. Alternatively, you can let rake take care of everything, as detailed in [http://octopress.org/docs/deploying/github/ this guide]. | |||
I'll cover both. | |||
===Manually Create Branch=== | |||
You want to create the gh-pages branch. Assuming you've already cloned the project, check out the gh-pages branch for the first time as an orphan branch (i.e., totally empty): | |||
<pre> | |||
git checkout --orphan gh-pages | |||
</pre> | |||
Now make sure there's nothing in the branch already. You can clean it out: | |||
<pre> | |||
git rm -rf . | |||
</pre> | |||
and commit changes when ready: | |||
<pre> | <pre> | ||
git | git commit -am "init commit" | ||
git push origin gh-pages | |||
</pre> | </pre> | ||
Now you can visit your site at <code>http://username.github.io/projectname</code> and see the live content. | |||
Revision as of 02:41, 9 April 2014
Every project can also create a collection of hosted GitHub pages. To do this, you can create a branch called gh-pages that will be completely separate from your other branches and will contain all of the content served by the web server when you go to the page http://username.github.io/project
The Procedure
Create Local Copy of Project
First thing you'll need to do is clone your project from Github:
git clone https://github.com/charlesreid1/project
Checkout Web Content Branch
Now, web content is served from a special branch in the Github repository, the gh-pages branch. Everything in that branch is hosted by Github pages web servers.
You have a few different options for creating this branch. If you wanted to create and host a couple of pages of your own content, you could manually create a gh-pages branch, as detailed in this guide. Alternatively, you can let rake take care of everything, as detailed in this guide.
I'll cover both.
Manually Create Branch
You want to create the gh-pages branch. Assuming you've already cloned the project, check out the gh-pages branch for the first time as an orphan branch (i.e., totally empty):
git checkout --orphan gh-pages
Now make sure there's nothing in the branch already. You can clean it out:
git rm -rf .
and commit changes when ready:
git commit -am "init commit" git push origin gh-pages
Now you can visit your site at http://username.github.io/projectname and see the live content.