Skip to content
UNASPACE

GitHub

This content is for Frontend. Switch to the latest version for up-to-date documentation.

GitHub is a cloud-based platform for hosting Git repositories. It adds collaboration features on top of Git — pull requests, code reviews, issue tracking, project boards, and CI/CD via GitHub Actions.

GitHub is the largest code hosting platform in the world, with over 100 million developers.

GitGitHub
WhatVersion control toolCloud platform for hosting Git repos
RunsLocally on your machineIn the browser / cloud
PurposeTrack changes, branch, mergeCollaborate, review, deploy
Required?Yes (core tool)No (alternatives exist), but widely used
  1. Click New on GitHub.
  2. Name it, choose public/private, optionally add a README and .gitignore.
  3. Clone it locally:
Terminal window
git clone https://github.com/your-username/my-project.git
cd my-project

If you already have a local Git repo:

Terminal window
git remote add origin https://github.com/your-username/my-project.git
git branch -M main
git push -u origin main

A Pull Request is GitHub’s mechanism for proposing changes and requesting code review before merging.

Diagram
  1. Create a branch and make your changes.
  2. Push the branch to GitHub.
  3. Open a Pull Request from the GitHub UI.
  4. Teammates review the code — leave comments, request changes, or approve.
  5. Once approved, merge the PR into main.
  6. Delete the feature branch (cleanup).
Terminal window
# Push your branch
git push origin feature/user-auth
# Then open a PR on GitHub via the web UI
  • Title: Short and descriptive (e.g., “Add user authentication flow”).
  • Description: Explain what changed, why, and how to test it.
  • Small PRs: Smaller changes are easier and faster to review.
  • Screenshots: Include UI screenshots for frontend changes.

Code reviews are one of the most valuable practices in software development:

  • Catch bugs before they reach production.
  • Share knowledge across the team.
  • Improve code quality through discussion.
  • Onboard new members by exposing them to different parts of the codebase.
  • Be respectful and constructive.
  • Explain why something should change, not just what.
  • Approve when it’s good enough — perfection is the enemy of progress.

Issues are GitHub’s way to track bugs, feature requests, tasks, and discussions.

  • Use labels to categorize (e.g., bug, enhancement, documentation).
  • Use milestones to group issues into releases or sprints.
  • Reference issues in commits: git commit -m "Fix login redirect (closes #42)" — this automatically closes issue #42 when merged.

GitHub Actions lets you automate workflows directly in your repository. Common uses: run tests on every push, deploy on merge to main, lint code on PRs.

.github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install
- run: npm test
TermMeaning
WorkflowA YAML file defining automated tasks (lives in .github/workflows/).
Trigger (on)The event that starts the workflow (push, PR, schedule, manual).
JobA set of steps that run on the same machine.
StepA single task — run a command or use a pre-built action.
ActionA reusable unit of work (e.g., actions/checkout@v4).

GitHub Pages is free static site hosting directly from a GitHub repository. Great for documentation, portfolios, and project landing pages.

  • Enable in Settings → Pages.
  • Deploy from main branch, a /docs folder, or a GitHub Actions workflow.

GitHub is the most popular, but alternatives exist:

PlatformNotes
GitLabGit hosting with built-in CI/CD. Self-hosting option. Popular in enterprise.
BitbucketGit hosting by Atlassian. Integrates tightly with Jira.
GiteaLightweight, self-hosted Git platform.
Built with passion by Ngineer Lab