Episode 10 of 12

Introduction to GitHub

Learn what GitHub is and how to push your local repository to GitHub.

GitHub is a cloud platform for hosting Git repositories. It adds collaboration features like pull requests, issues, and project management.

Git vs GitHub

  • Git — a version control tool that runs locally on your computer
  • GitHub — a cloud service that hosts Git repositories online

Creating a GitHub Repository

  1. Go to github.com and sign up / log in
  2. Click the + icon → New repository
  3. Name your repo, add a description, choose public or private
  4. Click Create repository

Connecting Local Repo to GitHub

# Add the remote repository
git remote add origin https://github.com/username/repo-name.git

# Verify the remote
git remote -v

# Push your code to GitHub
git push -u origin main

Push and Pull

# Push local commits to GitHub
git push

# Pull changes from GitHub
git pull

# Fetch without merging
git fetch

Cloning a Repository

git clone https://github.com/username/repo-name.git

SSH vs HTTPS

# HTTPS (easier setup, prompts for password)
git clone https://github.com/user/repo.git

# SSH (requires SSH key setup, no password prompts)
git clone git@github.com:user/repo.git

GitHub Features

  • Pull Requests — propose and review code changes
  • Issues — track bugs and feature requests
  • Actions — automate workflows (CI/CD)
  • Pages — host static websites for free
  • Wiki — project documentation