MASTER YOUR
CODE HOSTING

// The world's largest code platform.

GITHUB CHANGED HOW WE COLLABORATE ON CODE.

GitHub hosts over 100 million repositories. It's the home for open source, the platform for team collaboration, and the foundation for modern DevOps workflows with GitHub Actions.

WHY GITHUB?

GitHub provides free hosting for public repos, integrated CI/CD with Actions, project management tools, and the world's largest community of developers. Your code lives in the cloud, backed up, and accessible anywhere.

JOIN THE REVOLUTION.

From personal projects to enterprise teams, GitHub powers how we build software together. Fork repos, submit pull requests, automate workflows, and ship faster with the world's most popular code platform.

BEGIN YOUR JOURNEY →

// The Path to Mastery

10 lessons. Complete GitHub control.

LESSON 01

Introduction to GitHub

Understand GitHub, repos, and the ecosystem

Beginner
LESSON 02

Repositories

Create, clone, and manage repositories

Beginner
LESSON 03

Branching & Merging

Work with branches and pull requests

Beginner
LESSON 04

GitHub Issues

Track bugs and manage feature requests

Beginner
LESSON 05

Markdown & Documentation

Write READMEs and documentation

Beginner
LESSON 06

GitHub Actions

Automate CI/CD workflows

Intermediate
LESSON 07

Forks & Contributing

Contribute to open source projects

Intermediate
LESSON 08

GitHub CLI

Work with GitHub from terminal

Intermediate
LESSON 09

GitHub Pages

Host websites for free

Intermediate
LESSON 10

Security & Dependabot

Secure your repositories

Advanced

// Why GitHub

GitHub was founded in 2008 and acquired by Microsoft in 2018 for $7.5 billion. Today it hosts over 100 million repositories and has over 83 million developers.

GitHub isn't just storage—it's a complete platform for collaborative development. Issues track bugs and features. Actions automate testing and deployment. Projects provide Kanban boards. Codespaces offer cloud development environments.

For open source, GitHub is the de facto standard. Popular projects like Linux, Kubernetes, React, and millions of others call GitHub home. Fork any repo, submit improvements, and your code can be part of something bigger.

The world's code lives on GitHub. Make it yours.

// Tools & References

📖 GitHub Docs

Official Documentation

docs.github.com

💻 GitHub CLI

Command Line Interface

cli.github.com

⚡ Actions

CI/CD Automation

Actions

📝 GitHub Pages

Static Site Hosting

pages.github.com

🔒 Security

Security Features

Security

🐙 Codespaces

Cloud IDE

Codespaces

// Introduction to GitHub

×

What is GitHub?

GitHub is a cloud-based platform for hosting and collaborating on Git repositories. While Git is the version control system, GitHub provides the infrastructure, tools, and community around it.

Key GitHub Concepts

  • Repository: A project folder that stores all files and their history
  • Remote: The cloud copy of your repo on GitHub
  • Fork: Your copy of someone else's repository
  • Clone: Download a repo to your local machine
  • Push: Upload commits from local to remote
  • Pull: Download changes from remote to local
GITHUB'S PHILOSOPHY: "GitHub is where people build software." It's not just for developers—anyone can participate in open source, file bug reports, or contribute documentation.

GitHub vs Git

# Git - distributed version control system # GitHub - cloud platform hosting Git repos # GitLab, Bitbucket - similar competing platforms

Getting Started

$ git init # Create local repository $ git remote add origin https://github.com/username/repo.git # Link to GitHub repository

Quiz

1. GitHub hosts _____ repositories.

Hint: Version control system

2. A _____ is a copy of someone else's repository.

Hint: F-word

3. Download a repo with git _____.

Hint: Copy command

4. Upload commits with git _____.

Hint: Opposite of pull

5. A project folder is called a _____.

Hint: Repo

Show Answers

Answers

1. Git

2. Fork

3. Clone

4. Push

5. Repository

// Repositories

×

Creating Repositories

Repositories can be public (visible to everyone) or private (only visible to you and collaborators you invite).

GitHub Repository URL Format

# HTTPS format https://github.com/username/repository-name # SSH format git@github.com:username/repository-name # Clone with HTTPS git clone https://github.com/username/repo.git

Repository Setup

$ git init Initialized empty Git repository $ git add README.md $ git commit -m "Initial commit" [main abc1234] Initial commit $ git remote add origin https://github.com/user/repo.git $ git push -u origin main # Push and set upstream

README Files

A README.md in your repository root is automatically displayed on GitHub. It's your project's documentation—explain what it does, how to install it, and how to contribute.

Quiz

1. Public repos are visible to _____.

Hint: All people

2. -u flag in push sets the _____ branch.

Hint: Upstream

3. README files are written in _____.

Hint: md

Show Answers

Answers

1. Everyone

2. Upstream

3. Markdown

// Branching & Merging

×

Pull Requests

A Pull Request (PR) proposes your changes to a repository. It allows review, discussion, and approval before merging code into the main branch.

PR Workflow

$ git checkout -b feature/my-feature Switched to new branch 'feature/my-feature' $ git add . $ git commit -m "Add new feature" $ git push origin feature/my-feature # Push branch to GitHub # Then create PR on GitHub web interface

Branch Protection

Branch protection rules prevent direct pushes to main. Require PR reviews, status checks, or specific approvers before merging.

Quiz

1. A _____ Request proposes code changes.

Hint: P-R

2. Create branch with git checkout -b _____.

Hint: Branch name

3. Main branch protection prevents _____ pushes.

Hint: Straight to

Show Answers

Answers

1. Pull

2. branch-name

3. Direct

// GitHub Issues

×

What are Issues?

Issues track bugs, feature requests, and tasks. They provide a discussion thread attached to your repository, separate from code changes.

Issue Labels

# Common labels bug # Something isn't working enhancement # New feature request documentation # Improvements to docs help-wanted # Extra attention needed good-first-issue # Good for beginners

Issue Workflow

# # Create issue on GitHub web interface # # Reference in commit: $ git commit -m "Fix login bug (closes #42)" # Closes issue #42 automatically when merged

Quiz

1. Issues track _____ and features.

Hint: Software errors

2. _____ labels categorize issues.

Hint: Also called labels

3. (closes #42) in commit message _____ issue 42.

Hint: Verb

Show Answers

Answers

1. Bugs

2. Tags

3. Closes

// Markdown & Documentation

×

GitHub Flavored Markdown

GitHub uses Markdown with extensions for tables, task lists, code blocks, and more.

Common Markdown

# Headers # H1 ## H2 ### H3 # Lists - Item 1 - Item 2 - Nested item # Task list - [x] Done - [ ] Not done # Code `inline code` ```bash code block ```

README Template

# Project Name Description of what this project does. ## Installation ```bash npm install ``` ## Usage ```bash npm start ``` ## Contributing Pull requests welcome! ## License MIT

Quiz

1. README files use _____ format.

Hint: .md

2. Code blocks use three _____.

Hint: ` ` `

3. Task lists use [ ] with _____ or x.

Hint: Blank

Show Answers

Answers

1. Markdown

2. Backticks

3. Space

// GitHub Actions

×

What are GitHub Actions?

GitHub Actions automate workflows: test code, build packages, deploy to servers—all triggered by events like push or pull request.

Basic Workflow

name: CI

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run tests
        run: npm test

Common Actions

# Checkout code uses: actions/checkout@v4 # Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' # Deploy uses: peaceiris/actions-gh-pages@v3

Quiz

1. Actions are triggered by _____ events.

Hint: Like push

2. Actions run on _____-latest by default.

Hint: Linux distro

3. uses: keyword loads _____ from marketplace.

Hint: Reusable units

Show Answers

Answers

1. GitHub

2. Ubuntu

3. Actions

// Forks & Contributing

×

What is a Fork?

A fork is your personal copy of someone else's repository. You can experiment freely without affecting the original project.

Contributing Workflow

$ # Fork on GitHub, then clone your fork $ git clone https://github.com/your-username/repo.git $ git remote add upstream https://github.com/original/repo.git $ git checkout -b fix-bug $ # Make changes and push $ git push origin fix-bug # Create PR from your fork to original

Keeping Fork Updated

$ git fetch upstream $ git checkout main $ git merge upstream/main

Quiz

1. A _____ is your copy of someone else's repo.

Hint: F-word

2. Add original as upstream with git remote add _____.

Hint: Direction

3. Sync fork with git fetch _____.

Hint: Same as before

Show Answers

Answers

1. Fork

2. Upstream

3. Upstream

// GitHub CLI

×

GitHub CLI Overview

gh is the official GitHub command-line tool. Create PRs, manage issues, and interact with GitHub without leaving your terminal.

Essential Commands

$ gh repo clone user/repo # Clone repository $ gh issue list # List open issues $ gh issue create --title "Bug" --body "Details" # Create issue $ gh pr create --title "Feature" --body "Description" # Create pull request $ gh pr checkout 42 # Checkout PR locally $ gh pr merge 42 # Merge PR

Authentication

$ gh auth login # Authenticate with GitHub $ gh auth status # Check authentication

Quiz

1. The GitHub CLI command is _____.

Hint: Two letters

2. Create PR with gh _____ create.

Hint: Pull Request

3. Authenticate with gh auth _____.

Hint: Sign in

Show Answers

Answers

1. gh

2. Pr

3. Login

// GitHub Pages

×

What is GitHub Pages?

GitHub Pages hosts static websites directly from your repositories. Perfect for documentation, portfolios, and project sites—free hosting with your own subdomain.

Enabling Pages

# Settings → Pages → Source # Select branch (usually main or gh-pages) # Your site appears at: # https://username.github.io/repo-name

Custom Domains

# # Add CNAME file to repo root with your domain # # Configure DNS: # # CNAME: www → username.github.io # # A: @ → 185.199.108.153

Quiz

1. GitHub Pages hosts _____ websites.

Hint: No backend

2. Add custom domain with _____ file.

Hint: Domain name file

3. Site URL format: username.github._____.

Hint: Not .com

Show Answers

Answers

1. Static

2. CNAME

3. io

// Security & Dependabot

×

Repository Security

GitHub provides security features to protect your code: vulnerability alerts, dependency scanning, and secret scanning.

Security Tab

# Security → Overview shows: # - Vulnerability alerts # - Dependency graph # - Secret scanning alerts # - Code scanning alerts

Dependabot

Dependabot automatically creates PRs to update outdated dependencies. Enable it with a simple configuration file.

# .github/dependabot.yml version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "weekly"

Quiz

1. Dependabot updates _____ dependencies.

Hint: Old

2. Dependabot creates _____ requests.

Hint: PRs

3. Secret _____ scans for exposed keys.

Hint: Finding

Show Answers

Answers

1. Outdated

2. Pull

3. Scanning