Core Interaction

GitHub

Friday, 1/24 – Lab

Create a GitHub account and repository

  1. Sign up for a GitHub account using your newschool username and email.
    • If you already have a GitHub account and repository under your newschool username rename the old repository to something else, for example fisherdm.github.io.2018.
  2. Create a new repository named YOUR_USERNAME.github.io, e.g. fisherdm.github.io

Set up your local machine

Install Git

  1. Open Terminal on your Mac Applications > Utilities > Terminal
  2. Type git and press enter
  3. Follow the instructions on screen to install OS X Dev Tools and Git
  4. Once installed, type git again and you should see git’s help text. This means it’s installed correctly.

Create and add an SSH key to your GitHub account

  1. Create an SSH key
  2. Add SSH key to GitHub

Set your Git username and email

  1. git config --global user.name "YOUR NAME"
  2. git config --global user.email "YOUR EMAIL ADDRESS"

Download and install software

  1. Sublime Text
    • If you have a preferred text editor you may use that instead.

Set up your working repository

Clone your repository

cd ~                       # change directory to home directory
git clone YOUR_REPO_PATH   # clone the new repo you created on GitHub e.g. git clone git@github.com:fisherdm/fisherdm.github.io.git
cd fisherdm.github.io      # change directory into the repo you just cloned

Upload your changes to the GitHub

  1. Create a file in your YOUR_USERNAME.github.io directory named index.html
  2. Use git to add this file and commit the changes to GitHub:
git add .                    # tell git you want to add all files
git commit -m 'first commit' # commit these files with a message
git push                     # push these files to GitHub, the remote server

View your new website

Visit your new website at http://YOUR_USERNAME.github.io