I have been spending most of my time lately working on projects around web development. One of the most amazing tools I've found during this process is GitHub Pages. This article will walk you through creating a 'Hello, World' website hosted on GitHub Pages. Everything here is 100% free. If you learn better from videos, scroll down to the bottom of this article for a video walkthrough.
If you already have a GitHub account, great! Â Feel free to skip to step 2. Â If not, no worries! Â Creating a GitHub account is easy and will boost your visibility and credibility as a developer. Â In a way, a GitHub account is like a LinkedIn account for developers. Â GitHub allows you to put your code under version control and store it on a server (aka "In the cloud") so that even if you lose your computer or hard drive, all your code will still be accessible through your GitHub account. Â There are many different types of version control systems (vcs) such as subversion (svn), mercurial, and git. Â GitHub, as you may have guessed, uses git. Â They all have different strengths and weaknesses, but overall git is probably the easiest to get started with and is the go-to vcs system for the majority of developers. Â Version control systems are outside the scope of this tutorial, but you can find a short comparison of some of the most popular version control systems here. Â A nice Youtube playlist with introductory git videos published by GitHub can be found here.
To make an account on GitHub, head on over to their webpage at https://github.com/. Â They have a really simple process for creating an account, so simply pick a username, enter your email address, and choose a (strong) password, and you're good to go!
Next we will create the repository we will use for our GitHub Pages site. Â First a quick, but important note on repositories created with GitHub. Â GitHub has a free plan and a paid plan. Â The main difference between a free and paid plan on GitHub is the ability to create a private repository. Â With a free plan, all repositories you create will be public. Â That means anyone can see the code/files/ect. that you upload or create in the repository. Â Therefore it is super important that you do not put any private information in a public GitHub repository. Â Whatever you put in a public GitHub repository, you are sharing with the world. Â Using the free plan works great for this tutorial, as we will be adding a simple 'Hello, World' webpage to our repository, but keep in mind that if you want to be the only one with access to your GitHub repositories, you will need to upgrade to a paid account, which is currently $7 a month. Â If you're a college student, GitHub will give you unlimited free private repositories and many other benefits; you can find more info here.
Steps to create a repository:
Click the 'New Repository' button
Enter the repository details as shown below and then click the green 'Create repository' button.
Click the 'Settings' button on the repository home page.
Once you are on the settings page, scroll down to the 'GitHub Pages' section and choose the master branch for the source.
After enabling GitHub Pages for the repository, the next step is to create your website! Â Head back to the 'Code' tab in GitHub as shown below.
To create a homepage for your website, click on the 'Create new file' button.
Next enter the information shown below to create the index.html file.
Great! Now it's time to visit your new website! Â Head back to the 'Settings' tab and click on your GitHub Pages URL in the GitHub Pages section. Â Note: It may take 5-10 minutes for the link to show your updated site.
Congratulations! Your website should be live on the internet! Â Now you can utilize your web development skills to make an awesome website without having to pay a penny for hosting!
If you were checking out the options under the GitHub Pages section, you will have noticed that you can choose a theme. Â Themes are an easy way to get a great looking webpage up and running in no time! Â After choosing a theme, you will need to delete the index.html file you created to see the theme take effect.
Did you create a static site on GitHub? Â If so, post a link in the comments below so others can see it and gain some inspiration!
Decide to watch this tutorial instead of reading it? Â Great! Â Hit play below.
Need to keep up with a fast-moving software industry?