Introduction to GitHub
What is GitHub?
GitHub is a web platform that hosts Git repositories online. It adds collaboration features on top of Git:
| Feature | What It Does |
|---|
| Remote repos | Store your code in the cloud |
| Pull Requests | Propose and review changes |
| Issues | Track bugs and feature requests |
| Actions | Automate testing and deployment |
| Pages | Host websites for free |
Local vs Remote
Your Computer (Local) GitHub (Remote)
┌──────────────┐ ┌──────────────┐
│ my-project/ │ ──push──> │ my-project │
│ .git/ │ <──pull── │ (hosted) │
└──────────────┘ └──────────────┘
- push = send your commits to GitHub
- pull = download others' commits from GitHub
- clone = download an entire repo for the first time
Key Commands
# Clone a repo from GitHub
git clone https://github.com/username/repo.gitConnect local repo to GitHub
git remote add origin https://github.com/username/repo.gitPush your commits
git push origin mainPull latest changes
git pull origin main
Creating a GitHub Repository
- Go to [github.com](https://github.com) and sign in
- Click the + button → New repository
- Name your repo, add a description
- Choose Public or Private
- Click Create repository
- Follow the instructions to push your local code
Alternatives to GitHub
| Platform | Notes |
|---|
| GitLab | Popular for DevOps, self-hostable |
| Bitbucket | Integrates with Atlassian tools |
| Codeberg | Open-source, non-profit |
They all use Git — the commands are the same!Summary
| Command | Purpose |
|---|
git clone URL | Download a repo |
git remote add origin URL | Link local to remote |
git push origin main | Upload commits |
git pull origin main | Download new commits |
Learn how GitHub extends Git for collaboration.
Ready to practice? Click "Mark Complete" and move to the next lesson to apply what you've learned.