By: Sabrina Davidson
Getting started with GitHub and GitHub Pages. If you’ve never heard of GitHub, GitHub is a “provider of Internet hosting for software development and version control using Git. It offers the distributed version control and source code management functionality of Git, plus its own features.” (Github, n.d.) These features include collaboration and the ability to work from anywhere on a piece of code. These are great features if you’re working on a large-scale project with team members from all over the world.
I have been using GitHub since I started getting more into the more intense coding for web development with the use of python. GitHub has some really great features like GitHub Pages. GitHub Pages is where GitHub will actually host your coded website or web application for free. Granted you will not have control over the domain name but it’s a great way to get your code out there and tested. I think this is super great since it’s FREE (did I mention that)!
This is my guide to getting your code live on GitHub and then view it as an actual website. I’ll be using the Git client from the terminal but you can also use the GitHub desktop.
Step 1. Create A Repository
Login to your account on GitHub and create a new public repository named: “username.github.io, where username is your username (or organization name) on GitHub.” This needs to match exactly with your username or it will not work.
Tip: Always double-check your username for your project that way you have it correct. Especially if this is your first time making a repository.
Step 2: Clone the Repository on your Computer
Go to the folder where you want to store your project, and clone the new repository:
Your command should be:
git clone https://github.com/username/username.github.io
Step 3: Create or Add your Files to the Repository
Enter in the project folder and add your files.
You can do this from the terminal as well by using cd or changing into the directory to your project folder.
Step 4: Push it to Git
Once you have your files added, commit and push you changes to git (FreeCodeCamp, 2020)
The Add command adds new or changed files in your working directory to the Git staging area. (FreeCodeCamp, 2020)
The Commit creates a commit, which is like a snapshot of your repository. These commits are snapshots of your entire repository at specific times. You should make new commits often, based around logical units of change. (FreeCodeCamp, 2020)
Push allows you to send (or push) the commits from your local branch in your local Git repository to the remote repository. (FreeCodeCamp, 2020)
Step 5: Go to your browser to preview your pages.
Your link should look something like this: https://username.github.io.
There are other features that you can use with github like blogging with Jekyll add custom URLs and custom 404 pages and submodules. Let me know in the comments if you would like to see a tutorial for any of these features as well.
If your looking to get started in technology or need help making your digital dreams If you need help getting started digitally or just want to reach out check out my services and contact page.
Thanks for reading Tech Byte with Brina.
FreeCodeCamp. (2020, January 3). The Git Push Command Explanied. Retrieved from Free Code Camp : https://www.freecodecamp.org/news/the-git-push-command-explained/
Github. (n.d.). Github . Retrieved from Github: github.com
Sabrina Davidson, a tech enthusiast and passionate advocate for empowering others through technology, is dedicated to sharing her expertise, insights, and experiences to inspire and guide individuals in navigating the ever-changing digital landscape.