Um momento
0x00Lesson 1 of 14

What is GitHub?

Tell Git from GitHub, find your way around a repository page, and see how people collaborate there.

18 min 7-question quiz 2 code exercises
By the end of this lesson you can
  • Explain the difference between Git and GitHub
  • Navigate a repository: code, issues, pull requests, actions and settings
  • Describe accounts, organizations, visibility, stars, watching and forks

Welcome to Dungeon Dash, a scrappy open-source retro game: pixel-art heroes, procedurally generated dungeons, and a small, enthusiastic team of volunteer maintainers. You’ve just been invited to help. Over this track you’ll go from your first pull request to shipping releases with automated tests, security checks and a release bot you write yourself.

First, an important distinction:

  • Git is the version control tool on your computer. It tracks history in a repository and works offline. (The Git track covers it.)
  • GitHub is a website and service that hosts Git repositories and builds collaboration around them: issues, pull requests, code review, automation with Actions, project boards, security scanning, releases and more.

GitHub isn’t the only host - GitLab, Bitbucket, Codeberg and others do similar jobs - but with over 100 million developers, it’s where most open source lives.

A tour of a repository page

Every repository lives at github.com/OWNER/REPO - Dungeon Dash is github.com/dungeon-dash/dungeon-dash. The tabs across the top are the map of this whole track:

TabWhat it’s forLesson
Codefiles, branches, commits, the READMErepositories, Markdown
Issuesbug reports, feature ideas, tasksissues and projects
Pull requestsproposed changes, waiting for reviewpull requests, code review
Actionsautomated workflows: tests, builds, deploysActions, CI
Projectsboards and tables for planningissues and projects
Securityalerts about vulnerable dependencies and leaked secretssecurity
Settingscollaborators, branch protection, secrets (maintainers only)everywhere

Owners are either personal accounts (@mira) or organizations (@dungeon-dash), which group people into teams with different permissions. Repositories are public (anyone can read) or private (only people you invite).

Try it

Git or GitHub?

Which one provides each feature? Remember: Git is the tool on your machine; GitHub is the service built around hosting.

0 of 7 sortedScore 0/0
  • “Commits and branches”

  • “Pull requests with review comments”

  • “Issues and labels”

  • “git log and git diff”

  • “Running tests automatically on every push”

  • “Merging two branches”

  • “Stars and forks”

A few social buttons you’ll see on every repository:

  • Star - bookmark a project and show appreciation. Stars are how people roughly gauge popularity.
  • Watch - get notifications about activity (all of it, only releases, or nothing).
  • Fork - your own copy of the repository under your account, so you can change it and propose those changes back. (Unit 2 covers forks.)

Automating GitHub

Everything you can click on GitHub, you can also script: through the gh command-line tool, the REST and GraphQL APIs, and Actions. That’s why this track’s exercises are small Python programs - the kinds of helpers maintainers actually write. Here’s the first: pulling the owner and name out of the many shapes a repository URL can take.

repo_url.py
1import re
2
3PATTERN = re.compile(r"(?:https://|git@)?github\.com[/:]([\w.-]+)/([\w.-]+?)(?:\.git)?(?:/.*)?$")
4
5for url in ["https://github.com/dungeon-dash/dungeon-dash",
6            "git@github.com:mira/pixel-heroes.git",
7            "github.com/dungeon-dash/dungeon-dash/issues/42",
8            "https://gitlab.com/someone/thing"]:
9    match = PATTERN.match(url)
10    print(f"{match.group(1)}/{match.group(2)}" if match else "not a GitHub repo")
Output
dungeon-dash/dungeon-dash
mira/pixel-heroes
dungeon-dash/dungeon-dash
not a GitHub repo

Key takeaways

  • Git tracks history locally; GitHub hosts Git repositories and adds collaboration around them.

  • A repository page’s tabs - Code, Issues, Pull requests, Actions, Projects, Security - map the platform.

  • Repos belong to personal accounts or organizations, and are public or private.

  • Star to bookmark, watch for notifications, fork to get your own copy to change.

Lesson quiz

7 questions · pass with 5 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Practice: automate GitHub chores with Python

Real GitHub work involves lots of small automation: matching CODEOWNERS, expanding build matrices, bumping versions, reading the API. Write those helpers in Python and run them against sample inputs - locally in your browser, with no GitHub account needed.

Exercise 1

Which repository is this?

+25 XP

Each input line is a link someone pasted in the Dungeon Dash chat. Print owner/repo for GitHub repository links in any of these shapes, or not a GitHub repo otherwise:

  • https://github.com/OWNER/REPO (optionally ending in .git, a /, or any further path like /issues/42)
  • git@github.com:OWNER/REPO.git (the SSH form)
  • github.com/OWNER/REPO without the scheme

Owner and repo names use letters, digits, -, _ and ..

  • Many shapes
  • Not GitHub
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Exercise 2
+25 XP

Each input line is a JSON object describing a repository, like the GitHub API returns: {"full_name": ..., "stargazers_count": ..., "forks_count": ..., "language": ...}. Print the top 3 by stars as 1. owner/repo (520 stars, 40 forks), then the number of repositories per language, most common first (ties alphabetically), as Python: 2. A null language counts as unknown.

  • Five repos
main.py
Loading editor…

Python runs in a sandboxed browser worker with a 60 second time limit. Its runtime loads from the Pyodide CDN; your code stays in this browser.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…

Gostou da aula? 😆👍
Apoie nosso trabalho com uma doação: