![]() This tutorial walks you through the process of creating a GitHub Pages site! In other words, you can use a GitHub repository to host your HTML, CSS, and JavaScript files. GitHub Pages lets you take a GitHub repository and turn it into a webpage. It’s a little bit like social media for coders, and it’s a great way to show off your code and to see what other folks are working on. GitHub is a website that lets you post your code so you can keep it organized and share it with other people. It can also be a useful structure for directing output from static site generators like Jekyll, Webby, or nanoc.Jekyll GitHub Pages tutorial html github-pages If everything has gone well you now have a parent project folder named "grandmaster", with subfolders for its two branches "master" and "gh-pages" each containing a checkout of their respective branch.įor me this system keeps things nice and tidy without needing to do git checkout each time I want to view my "gh-pages" branch. ![]() Visit your projects "gh-pages" branch page on GitHub to see the committed files. Now push to the "gh-pages" branch ichris:gh-pages $ git push origin gh-pages Ichris:gh-pages $ git commit -m "Child README added" GitHub Pages README file" > README.textile Lets add a "README.textile" file to the "gh-pages" branch ichris:gh-pages $ echo "h1. You will probably get a warning when deleting the "master" branch. Ichris:gh-pages $ git checkout origin/gh-pages -b gh-pages Last step is to check that "master" branch was removed and only "gh-pages" branch is listed. Ĭlone your "grandmaster" repository into the "gh-pages" folder (this will clone in the "master" branch), checkout the "gh-pages" branch, list the files (should have "index.html" and ".git") and then remove the "master" branch to avoid any confusion. Or follow these steps to get to the generator page:Ī popup will ask you to "Activate GitHub Pages" - click the big "Automatic GitHub Page Generator" buttonĬheck that your GitHub Pages page has been built and is available.īack in Terminal.app, change directory back to the parent folder, setup a "gh-pages" subfolder for your "gh-pages" branch and change directory into it. ![]() Refresh your projects "master" branch page on GitHub to see the committed files.Īuto generate a GitHub Pages branch, with some default content. Ichris:master $ git remote add origin $ git push origin master Ichris:master $ git commit -m "Master README added" Ichris:master $ echo "# Master README file" > README.markdown Initialise a new git repository for the project and push the "master" branch to GitHub. Open Terminal.app, create project parent folder "grandmaster", and a subfolder for the "master" branch. Visit GitHub and create a new repository with the project name "grandmaster".ĭon't follow GitHub's Next steps instructions! Follow the steps below to setup your projects folders on your local system. grandmaster/gh-pages/.git # checkout of "gh-pages" branch (removed "master" branch)Ī note for GitHub novices - replace "chrisjacob" with your own GitHub username.Ī note for Terminal novices - you don't need to enter the "ichris:Sites $ " parts of the code listed below. grandmaster/master/.git # checkout of "master" branch The final folder structure on my local system is: /grandmaster ![]() Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").
0 Comments
Leave a Reply. |