Re:Instantly create beautiful GitHub project pages
by ajross on Monday April 02, 2012 @04:56PM
(#3790043)
You can create a local git containing only the gh-pages branch:
mkdir my-project-pages
cd my-project-pages
git init
git remote add origin [email protected]:myusername/myproject.git
git pull origin gh-pages
Now just treat them as distinct "repos" and push independently. The basic idea here is that you're breaking up "clone" (which by default pulls everything) into its composite steps.
Re:Instantly create beautiful GitHub project pages
by orta on Monday April 02, 2012 @01:40PM
(#3789211)
In a project I have where I generated pages based of code in my master I would have two folders that both were the same repo, one just stayed as master and the other as gh-pages. Meaning I could automate moving things and then pushing from that directory.
Re:Instantly create beautiful GitHub project pages
by mdehaan on Monday April 02, 2012 @02:48PM
(#3789501)
I find the gh_pages branch confusing too -- the idea that a branch doesn't contain something related to the other branches feels weird.
What I've found is it's easier to create a free organization, and that way you can get a organization.github.com project created and host the pages there.... this is easier than juggling the spare branch. Obviously smaller starter projects should not do this, but you could use username.github.com/yourproject name and not keep the documentation on the branch just as easily.
Presto, no gh_pages branch, but all of the advantages of hosting web content.
Re:Instantly create beautiful GitHub project pages
by dfc on Monday April 02, 2012 @02:05PM
(#3789292)
Does anyone know what would happen if inside my main repo I had a submodule that was just a checkout of my ghpages branch?
./project <- Main repo
./project/project-ghpages <- same repo but gh-pages branch
Re:Instantly create beautiful GitHub project pages
by barrybe on Monday April 02, 2012 @02:27PM
(#3789390)
That's how I do it, it works great that way. I didn't actually set up the gh-pages as a proper submodule, I just cloned the branch to a folder. Then I added the gh-pages folder to the top level .gitignore.
Am I missing something obvious?