TECHNICAL PRESENTATION

Introduction to
GitHub

Git Hosting, Collaboration & Automation
GitHub Actions GitLab CLI
📁 Repo → 🌿 Branch → 🔀 PR → 👀 Review → ✅ Merge → 🚀 Deploy

From repositories and pull requests to CI/CD pipelines and the GitHub CLI

Code  ·  Collaborate  ·  Automate  ·  Ship
01

Topics

Foundations

  • What GitHub is and why it matters
  • Repositories, branches, and pull requests
  • Markdown for docs, READMEs, and wikis
  • Code review workflows

Automation & Tooling

  • GitHub Actions — workflows, jobs, and steps
  • GitHub CLI (gh) for terminal-driven workflows
  • GitHub Pages, Releases, and Packages

Security & AI

  • Dependabot, code scanning, secret scanning
  • GitHub Copilot and AI-assisted development

GitLab & Alternatives

  • GitLab platform and CI/CD
  • GitHub vs GitLab — feature-by-feature comparison
  • Bitbucket, Gitea, and self-hosted options
02

What Is GitHub?

GitHub is the world's largest source code hosting platform, built on top of Git. It adds collaboration, code review, project management, CI/CD, and security tooling around Git's distributed version control.

Key facts

  • Founded 2008, acquired by Microsoft in 2018 for $7.5 billion
  • 100+ million developers, 420+ million repositories (2024)
  • Free for public and private repos (with limits on Actions minutes)
  • Available as SaaS (github.com) or self-hosted (GitHub Enterprise Server)

What GitHub adds to Git

  • Pull requests — structured code review before merging
  • Issues & Projects — lightweight project management
  • Actions — CI/CD pipelines defined as YAML
  • Packages — host npm, Docker, Maven packages
  • Security — dependency scanning, secret detection
  • Pages — free static site hosting from a repo
  • Copilot — AI pair programming in the editor

GitHub is not Git. You can use Git without GitHub, and GitHub without the command line (though you shouldn't).

03

Repositories & the GitHub Interface

A repository (repo) is a project — source code, history, branches, issues, and settings in one place.

Anatomy of a GitHub repo

  • Code tab — file browser, branch selector, commit history
  • Issues tab — bug reports, feature requests, discussions
  • Pull requests tab — proposed changes awaiting review
  • Actions tab — CI/CD workflow runs
  • Settings — branch protection, secrets, webhooks, collaborators

Visibility

  • Public — anyone can see and fork; free
  • Private — only invited collaborators; free (with limits)
  • Internal — visible to all org members (Enterprise only)
FilePurpose
README.mdProject overview — rendered on the repo homepage
LICENSELegal terms for using the code
.gitignorePatterns for files Git should not track
CONTRIBUTING.mdGuidelines for contributors
CODEOWNERSAuto-assign reviewers based on file paths
.github/Actions workflows, issue templates, PR templates
04

Markdown on GitHub

GitHub uses GitHub Flavoured Markdown (GFM) — standard Markdown extended with tables, task lists, syntax-highlighted code blocks, and auto-linked references.

Essential syntax

# Heading 1
## Heading 2
### Heading 3

**bold** and *italic* and `inline code`

- bullet list
- [ ] task list (unchecked)
- [x] task list (checked)

[Link text](https://example.com)
![Alt text](image.png)

| Column A | Column B |
|----------|----------|
| cell     | cell     |

GitHub-specific extensions

  • #123 — auto-links to issue or PR number 123
  • @username — mentions a user (sends notification)
  • :emoji_name: — renders emoji
  • <details> — collapsible sections
  • Mermaid diagrams in fenced code blocks

Where Markdown is used

READMEs, issues, PRs, comments, wikis, GitHub Pages, release notes, discussion posts, and profile READMEs (username/username repo).

05

Branching & Pull Requests

A pull request (PR) is GitHub's mechanism for proposing, reviewing, and merging changes. It is the central unit of collaboration.

The PR workflow

Create branch
↓
Make commits
↓
Open PR
↓
CI runs + review
↓
Merge & delete branch

Draft pull requests

Open a PR as Draft to signal work-in-progress. CI still runs, but reviewers know it is not ready.

Branch protection rules

  • At least one (or two) approving reviews
  • All CI status checks to pass
  • No force pushes or deletions
  • Linear history (squash or rebase merges only)
  • Signed commits
  • Up-to-date branch before merging
StrategyResultWhen to use
Merge commitPreserves all commits + merge commitFull history matters
Squash and mergeOne commit on mainDefault for most teams
Rebase and mergeReplays commits onto mainLinear history purists
06

Code Review on GitHub

Code review is the highest-leverage quality practice a team can adopt. GitHub's review tools make it structured and asynchronous.

Review actions

  • Comment — feedback without explicit approval or rejection
  • Approve — "this is good to merge"
  • Request changes — "fix these issues before merging"

Inline suggestions

Click any line in the diff to leave a comment. Use suggestions to propose exact code changes the author can accept with one click:

```suggestion
const result = items.filter(Boolean);
```

Review best practices

  • Review within 24 hours — blocked PRs kill velocity
  • Focus on correctness, security, and maintainability
  • Explain why, not just what
  • Keep PRs small (< 400 lines) — large PRs get rubber-stamped
  • Use CODEOWNERS to auto-assign domain experts

CODEOWNERS file

# .github/CODEOWNERS
*.js        @frontend-team
*.py        @backend-team
docs/       @tech-writers
*.tf        @infra-team
07

GitHub Issues & Projects

Issues

  • Title, description (Markdown), labels, assignees, milestone
  • Templates: .github/ISSUE_TEMPLATE/bug_report.md or YAML forms
  • Close issues automatically: Fixes #42 in the PR description
  • Pin up to 3 issues to the top of the Issues tab
  • Transfer issues between repos in the same org

Labels & Milestones

Use labels to categorise: bug, enhancement, documentation, good first issue, priority:high. Group issues into milestones with a due date and progress bar.

GitHub Projects (v2)

  • Board view — Kanban columns (To Do, In Progress, Done)
  • Table view — spreadsheet-style with custom fields
  • Roadmap view — timeline with date ranges
  • Automation — auto-move items on PR merge, issue close
  • Scoped to an organisation or user — spans multiple repos

Issue forms (YAML)

# .github/ISSUE_TEMPLATE/bug_report.yml
name: Bug Report
description: Report a bug
body:
  - type: input
    id: version
    attributes:
      label: Version
    validations:
      required: true
08

GitHub Actions — Foundations

GitHub Actions is GitHub's built-in CI/CD and automation platform. Workflows are YAML files in .github/workflows/.

ConceptDescription
WorkflowA YAML file defining an automated process
Event / TriggerWhat starts the workflow (push, pull_request, schedule)
JobA set of steps on a single runner
StepA single task — shell command or reusable Action
RunnerThe VM or container executing the job
ActionReusable, packaged step from the Marketplace

Trigger examples

on:
  push:
    branches: [main]
  pull_request:
  schedule:
    - cron: '0 6 * * 1'   # Monday 06:00
  workflow_dispatch:        # manual trigger
  release:
    types: [published]

Runner options

  • GitHub-hosted — ubuntu-latest, windows-latest, macos-latest
  • Self-hosted — your own machines for GPU, on-prem, or cost control
  • Larger runners — more CPU/RAM (paid)
09

GitHub Actions — Workflow Syntax

Complete workflow example

# .github/workflows/ci.yml
name: CI
on:
  push:
    branches: [main]
  pull_request:
permissions:
  contents: read
jobs:
  lint-and-test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [18, 20, 22]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'
      - run: npm ci
      - run: npm run lint
      - run: npm test -- --coverage
  build:
    needs: lint-and-test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run build
      - uses: actions/upload-artifact@v4
        with:
          name: dist
          path: dist/

Key syntax elements

  • needs: — declare job dependencies
  • strategy.matrix — run across multiple configs
  • if: — conditionally run a step or job
  • env: — environment variables at any level
  • secrets.* — encrypted secrets
  • ${{ github.sha }} — expression context

Free tier

Unlimited Actions minutes for public repos. Private repos get 2,000 minutes/month on the Free plan.

10

GitHub Actions — Advanced Patterns

Reusable workflows

Define a workflow in one repo, call it from others. DRY for organisation-wide CI standards.

jobs:
  deploy:
    uses: my-org/shared/.github/
      workflows/deploy.yml@main
    with:
      environment: production
    secrets: inherit

Caching

- uses: actions/cache@v4
  with:
    path: ~/.npm
    key: npm-${{ hashFiles(
      '**/package-lock.json') }}
    restore-keys: npm-

Concurrency control

concurrency:
  group: deploy-${{ github.ref }}
  cancel-in-progress: true

Prevents duplicate runs — new commit cancels old run.

Environment protection

  • Define environments (staging, production) in settings
  • Require manual approval before deploying to production
  • Limit which branches can deploy to an environment
  • Add wait timers between deployments

Secrets & OIDC

  • Store secrets in repo or org settings — never in YAML
  • Use OIDC federation with AWS, GCP, Azure
  • Pin third-party Actions to full SHA, not tags
11

GitHub CLI (gh)

The GitHub CLI (gh) brings GitHub to the terminal. It replaces switching to the browser for PRs, issues, Actions, and more.

Installation

# macOS
brew install gh

# Ubuntu / Debian
sudo apt install gh

# Windows
winget install GitHub.cli

Authentication

gh auth login
gh auth status
gh auth switch

Repository operations

gh repo create my-app \
  --public --clone
gh repo clone owner/repo
gh repo fork owner/repo \
  --clone
gh repo view owner/repo \
  --web
gh repo list my-org \
  --limit 50

Pull request operations

gh pr create --title "Add X" \
  --body "Description"
gh pr list --state open
gh pr checkout 42
gh pr review 42 --approve
gh pr merge 42 --squash \
  --delete-branch
gh pr checks 42

Issue operations

gh issue create \
  --title "Bug" --label bug
gh issue list --assignee @me
gh issue close 99
12

GitHub CLI — Workflow Examples

Actions from the terminal

gh run list
gh run view 123456
gh run watch 123456
gh run rerun 123456
gh workflow list
gh workflow run deploy.yml
gh workflow run deploy.yml \
  -f env=staging

gh api — raw API access

# Get repo info
gh api repos/owner/repo

# List PR comments
gh api repos/owner/repo/\
  pulls/42/comments

# Create a label
gh api repos/owner/repo/labels \
  -f name="priority:critical" \
  -f color="d73a4a"

Aliases & extensions

# Create a custom alias
gh alias set prs \
  'pr list --state open \
  --assignee @me'
gh prs   # now works

# Install community extensions
gh extension install \
  dlvhdr/gh-dash
gh extension install \
  github/gh-copilot

Scripting with gh

# Close all wontfix issues
gh issue list --label "wontfix" \
  --json number \
  --jq '.[].number' \
  | xargs -I {} gh issue close {}

# Create PRs across repos
for repo in api web worker; do
  gh pr create \
    --repo "my-org/$repo" \
    --title "Bump deps"
done
13

GitHub Pages & Releases

GitHub Pages

Free static site hosting directly from a repository.

  • Serve from main, gh-pages, or /docs
  • Custom domains with HTTPS (free Let's Encrypt cert)
  • Built-in Jekyll support, or any static site via Actions
  • URL: username.github.io/repo-name

Pages via Actions

# .github/workflows/pages.yml
name: Deploy to Pages
on:
  push:
    branches: [main]
permissions:
  pages: write
  id-token: write
jobs:
  deploy:
    environment:
      name: github-pages
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/upload-pages-
          artifact@v3
        with:
          path: './dist'
      - uses: actions/deploy-
          pages@v4

Releases

  • Tag a commit with a version (v1.2.0)
  • Attach compiled binaries, installers, or archives
  • Auto-generate release notes from merged PRs
  • Mark as pre-release or latest

Create a release with the CLI

gh release create v1.2.0 \
  --title "v1.2.0" \
  --generate-notes \
  ./dist/app-linux \
  ./dist/app-macos \
  ./dist/app-windows.exe
14

GitHub Packages & Container Registry

GitHub Packages is a package registry integrated with GitHub. Host packages alongside your source code with unified permissions.

RegistryPackage typeURL
Container (GHCR)Docker / OCIghcr.io/owner/image
npmNode.jsnpm.pkg.github.com
MavenJava / Kotlinmaven.pkg.github.com
NuGet.NETnuget.pkg.github.com
RubyGemsRubyrubygems.pkg.github.com

Visibility & access

  • Packages inherit repo visibility by default
  • Public packages are free; private count toward storage
  • Fine-grained permissions — grant read/write per package
  • GITHUB_TOKEN provides automatic auth in Actions

Publishing a Docker image

# In a GitHub Actions workflow
- name: Log in to GHCR
  uses: docker/login-action@v3
  with:
    registry: ghcr.io
    username: ${{ github.actor }}
    password: ${{ secrets.
      GITHUB_TOKEN }}

- name: Build and push
  uses: docker/build-push-action@v5
  with:
    push: true
    tags: ghcr.io/${{
      github.repository
    }}:${{ github.sha }}
15

GitHub Security Features

GitHub provides multiple layers of supply chain and code security — most are free for public repos and included in GitHub Advanced Security for private repos.

Dependabot

  • Alerts — notifies when dependencies have known CVEs
  • Security updates — auto-opens PRs to bump vulnerable deps
  • Version updates — keeps dependencies fresh on a schedule
# .github/dependabot.yml
version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"

Code scanning (CodeQL)

Static analysis engine. Finds SQL injection, XSS, command injection by analysing data flow. Enable via Actions workflow.

Secret scanning

Automatically detects committed secrets — API keys, tokens, passwords. Over 200 partner patterns. Push protection can block the push before the secret reaches the remote.

Security advisories

  • Private vulnerability reporting — external reporters submit without public disclosure
  • Create advisories with CVE IDs
  • Coordinate patches before public announcement
16

GitHub Copilot & AI Features

GitHub Copilot is an AI pair programmer powered by large language models. It integrates into editors and the CLI.

ProductDescription
IndividualAI completions in VS Code, JetBrains, Neovim
BusinessOrg-managed, policy controls, audit logs
EnterpriseFine-tuned on your codebase, knowledge bases
ChatConversational AI in the editor and on github.com
CLIExplain and suggest terminal commands
In PRsAuto-generated PR summaries and review comments

Copilot Chat in the editor

  • Explain selected code: "What does this function do?"
  • Generate tests: "/tests for this function"
  • Fix errors: "/fix this error"
  • Refactor: "Rewrite this using async/await"
  • Workspace-aware: understands project context

Copilot in the CLI

gh copilot explain \
  "awk '{print $2}' file.txt"
gh copilot suggest \
  "find all .log files older \
  than 30 days"

Other AI features

  • Autofix — suggests fixes for code scanning alerts
  • Copilot Workspace — plan and implement changes from an issue
17

GitLab — Platform Overview

GitLab is an all-in-one DevSecOps platform. Where GitHub is a code host with bolted-on features, GitLab was designed as a single application covering the entire software development lifecycle.

EditionHostingCost
Community Edition (CE)Self-hosted onlyFree, open-source (MIT)
Enterprise Edition (EE)Self-hostedPaid tiers (Premium, Ultimate)
GitLab.comSaaSFree tier + paid plans

Single application philosophy

  • Built-in CI/CD — .gitlab-ci.yml, no marketplace
  • Built-in container registry — every project gets one
  • Built-in package registry — npm, Maven, PyPI, NuGet
  • Built-in wiki — per-project, Git-backed
  • Built-in SAST/DAST/SCA — security scanning in the pipeline
  • Review apps — deploy a live preview for every merge request

Key terminology differences

GitHubGitLab
RepositoryProject
Pull requestMerge request (MR)
GitHub ActionsGitLab CI/CD
OrganisationGroup
GitHub PagesGitLab Pages
CODEOWNERSCODEOWNERS
GistSnippet
18

GitLab CI/CD

Example pipeline

# .gitlab-ci.yml
stages:
  - build
  - test
  - deploy

build:
  stage: build
  image: node:22-alpine
  script:
    - npm ci
    - npm run build
  artifacts:
    paths:
      - dist/

test:
  stage: test
  image: node:22-alpine
  script:
    - npm ci
    - npm test -- --coverage

deploy_production:
  stage: deploy
  environment:
    name: production
  script:
    - ./deploy.sh production
  when: manual
  only:
    - tags
AspectGitLab CIGitHub Actions
ConfigSingle .gitlab-ci.ymlMultiple workflow files
Reusabilityinclude: templatesMarketplace, reusable workflows
RegistryBuilt-in, per projectGHCR (separate)
EnvironmentsFirst-class, review appsProtection rules
Auto DevOpsZero-config pipelineNo equivalent

GitLab-unique features

  • Auto DevOps — zero-config pipeline that builds, tests, scans, and deploys
  • Review apps — deploy every MR to a temporary environment
  • Multi-project pipelines — trigger pipelines across multiple projects
  • Merge trains — queue MRs and test in sequence to prevent broken main
19

GitHub vs GitLab — Detailed Comparison

FeatureGitHubGitLab
CI/CDActions (Marketplace)Built-in (templates)
Container registryGHCRBuilt-in, per project
Static analysisCodeQL (Advanced Security)Built-in SAST, DAST, fuzzing
Secret scanningBuilt-in + push protectionBuilt-in secret detection
Project managementIssues + Projects v2Issues + Boards + Epics
Self-hostedEnterprise Server (paid)CE (free) or EE (paid)
AI featuresCopilot (paid)Duo (paid)
EcosystemHuge — 20,000+ ActionsSmaller, template-based
Community100M+ developersSmaller but significant

When to choose GitHub

  • Open-source — largest community, discoverability, contributors
  • Teams already using the GitHub ecosystem
  • Projects that benefit from the Marketplace
  • When Copilot and AI-assisted development are priorities

When to choose GitLab

  • Single platform for the entire DevOps lifecycle
  • Self-hosted requirement with a free option (GitLab CE)
  • Built-in security scanning without extra licensing
  • Regulated industries requiring comprehensive audit trails
  • When review apps and Auto DevOps are valuable
20

Other Git Platforms

Bitbucket (Atlassian)

  • Tight integration with Jira and Confluence
  • Bitbucket Pipelines for CI/CD
  • Free for up to 5 users on private repos
  • Best for teams in the Atlassian ecosystem

Gitea

  • Lightweight, self-hosted Git server written in Go
  • Single binary — runs on minimal hardware (Raspberry Pi)
  • GitHub-like interface, MIT-licensed
  • No built-in CI — pair with Woodpecker CI or Drone

Forgejo

Community fork of Gitea (post-governance dispute). Identical feature set, different governance. Backed by Codeberg (non-profit hosting).

Azure DevOps

  • Microsoft's enterprise DevOps platform
  • Azure Repos (Git hosting) + Azure Pipelines (CI/CD)
  • Deep Azure cloud integration
  • Being succeeded by GitHub for many Microsoft-ecosystem teams
PlatformBest forCI/CDSelf-host
GitHubOpen source, communityActionsEnterprise (paid)
GitLabFull DevOps lifecycleBuilt-inCE (free)
BitbucketAtlassian shopsPipelinesData Center (paid)
GiteaLightweight self-hostExternalYes (free)
Azure DevOpsAzure enterprisesPipelinesServer (paid)
21

Summary & Next Steps

What we covered

  • GitHub as a platform — repos, branches, PRs, and code review
  • Markdown on GitHub — GFM, extensions, where it's used
  • Issues and Projects — lightweight project management
  • GitHub Actions — workflows, syntax, advanced patterns
  • GitHub CLI — terminal-driven workflows with gh
  • Pages, Releases, and Packages — hosting and distribution
  • Security — Dependabot, CodeQL, secret scanning
  • Copilot — AI-assisted development
  • GitLab — platform overview, CI/CD, unique features
  • GitHub vs GitLab — when to choose each

Recommended next steps

  1. Set up gh CLI and authenticate
  2. Add branch protection rules to your main branch
  3. Create a .github/workflows/ci.yml for your next project
  4. Configure Dependabot for automated dependency updates
  5. Try GitHub Projects (v2) for your next sprint
  6. Spin up a GitLab CE instance and compare workflows

Further reading

GitHub Docs — docs.github.com · GitHub CLI Manual — cli.github.com/manual · GitHub Skills — skills.github.com · GitLab Docs — docs.gitlab.com · Pro Git (2nd ed.) — git-scm.com/book (free)