Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Is GitHub and Why Developers Use It

Understand what GitHub is, how it differs from Git, what a remote repository does, and how the pieces of the platform fit together before you write a single command.

GitHub is a website and a set of services built around Git repositories. You keep your project's history in a repository on GitHub, and around that repository you get tools for working with other people: pull requests for reviewing changes, issues for tracking work, automation for running tests, and places to publish websites, packages and releases. Millions of open-source projects and a large share of company codebases live there.

This lesson sorts out the most common confusion for newcomers: Git and GitHub are not the same thing. Git is the version control program that runs on your computer. GitHub is a hosted service that stores Git repositories and adds a collaboration layer on top. If you have not used Git yet, read the Git tutorial alongside this track; the first chapters will make everything here easier.

This track describes the GitHub website, the git command and the gh command-line tool. The GitHub product cannot run inside this page, so the runnable examples are small JavaScript models that teach the same ideas: how repositories sync, how URLs are built, how permissions combine. They are labelled as stand-ins every time.

Git versus GitHub

Git GitHub
What it is A program on your computer A service on the internet
Works offline Yes, almost everything No, it needs a connection
Stores Commits, branches, tags The same data, plus issues, reviews, settings
Who owns it Open source project A company (owned by Microsoft)
Alternatives None needed, it is the standard GitLab, Bitbucket, Codeberg, self-hosted Forgejo

Because the repository itself is plain Git, you are never locked in: you can move a project to another host with a couple of commands. What stays behind are the extras that are not part of Git, such as issues and pull request discussions (you can export them, but they are not in the repository).

The core pieces

The GitHub building blocks

Repository Files plus full history
Pull request Propose and review changes
Issue Track bugs and ideas
Actions Automate tests and deploys

Most of this track is about how these four work together.

1 / 2

A repository (repo) is the project folder plus its complete history. A remote is a copy of the repository on another machine; the usual name for GitHub's copy is origin. You clone a remote to get your own local copy, commit locally, then push your new commits to the remote. Teammates fetch or pull them down.

flowchart LR
  A["Your computer<br/>local repository"] -- "git push" --> B["GitHub<br/>origin"]
  B -- "git fetch / git pull" --> A
  B -- "git clone" --> C["Teammate's computer"]
  C -- "git push" --> B

GitHub sits in the middle: everybody pushes to it and pulls from it.

A model of push and fetch

The remote does not magically update your folder. Each side has its own list of commits, and you decide when to exchange them. This stand-in models only the commit counts, which is exactly what git status reports as "ahead" and "behind".

JS Stand-in: ahead and behind

Press Run (or Ctrl + Enter) to see the console output here.

No output.

In real Git the commits are identified by hashes, and a pull that finds diverged work creates a merge or a rebase. The point here is only the rhythm: commit locally as often as you like, then synchronize.

Anatomy of a GitHub URL

GitHub URLs are predictable, and learning the pattern lets you jump anywhere quickly. The pattern is github.com/<owner>/<repo>/<view>/<ref>/<path>.

JS Stand-in: read a GitHub URL

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice blob means "one file", tree means "a folder", and for pull requests the fourth segment is the number, not a branch. A few more shortcuts: add .patch or .diff to a pull request or commit URL to get the raw change, and press . on a repository page to open it in the browser editor.

What you can do for free

A free personal account includes unlimited public and private repositories, a generous allowance of automation minutes, issues, projects, Pages hosting and the security basics for public code. Paid plans add team features, more automation minutes and advanced security tools for private code. Plans change over time, so check the pricing page rather than relying on any tutorial for the numbers.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which statement about Git and GitHub is correct?

    Git runs on your computer and works offline. GitHub is a hosting service built on Git repositories.
  2. 2. What is the conventional name of the remote that points to your repository on GitHub?

    git clone names the remote origin by default.
  3. 3. In the URL github.com/acme/site/blob/main/index.html, what does blob mean?

    blob views one file, tree views a folder.
  4. 4. You made two local commits and nobody else pushed. What does git status report?

    Local commits that origin does not have make you ahead until you push.

Summary

  • Git is local version control; GitHub is a hosted service built on Git repositories.
  • A remote (usually origin) is another copy of your repository; push sends commits, fetch and pull receive them.
  • GitHub adds pull requests, issues, automation, hosting and security tools around the repository.
  • URLs follow a pattern: owner, repo, view (blob, tree, pull), ref and path.

Next: Your GitHub Account and Profile