What is GitHub?

GitHub is a platform for hosting Git repositories, collaborating on code, and deploying projects. You’ll use it to store your code and optionally deploy it.

Create an Account

  1. Go to github.com and sign up
  2. Verify your email address
  3. Optionally set up a profile picture and bio

SSH keys let you push/pull code without entering your password each time.

Generate a Key

ssh-keygen -t ed25519 -C "your.email@example.com"

Press Enter to accept the default file location. Optionally set a passphrase.

Add the Key to GitHub

  1. Copy your public key:
# macOS
cat ~/.ssh/id_ed25519.pub | pbcopy
 
# Linux
cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard
 
# Windows (Git Bash)
cat ~/.ssh/id_ed25519.pub | clip
  1. Go to GitHub SSH Settings
  2. Click New SSH key
  3. Paste the key and give it a title (e.g., “My Laptop”)
  4. Click Add SSH key

Test the Connection

ssh -T git@github.com

You should see: “Hi username! You’ve successfully authenticated.”

Create a Repository

  1. Click the + icon in the top-right corner of GitHub
  2. Select New repository
  3. Name it (e.g., my-project)
  4. Choose Public or Private
  5. Check Add a README file
  6. Click Create repository

Clone to Your Machine

git clone git@github.com:your-username/my-project.git
cd my-project

For deploying static sites, see Deploying with GitHub Pages.