GitHub overview
Overview
Git manages history. GitHub is a service built around Git that adds everything a team needs to work together: a place to host repositories, a review process for changes, issue tracking, automation and more. Over 100 million developers use it, and most open-source projects live there.
This chapter tours GitHub’s core collaboration features. You’ll need a free account at github.com and, ideally, the GitHub CLI signed in (gh auth login, from the previous chapter).
A repository page
Every repository on GitHub has the same layout:
- Code: the files on the default branch, rendered README, branch and tag picker, commit history, and a Code button with the clone URLs.
- Issues: bug reports, feature requests and tasks.
- Pull requests: proposed changes waiting for review and merging.
- Actions: automated workflows — tests, builds, deployments.
- Projects: planning boards linked to issues and pull requests.
- Security: vulnerability alerts, secret scanning, security policy.
- Settings (for maintainers): access, branches and rules, merge options, integrations.
Two tips for exploring any repository: press t to search for a file by name, and press . to open the repository in a web-based editor (github.dev).
Public and private
- Public repositories can be read and cloned by anyone; only people you give access to can push.
- Private repositories are only visible to you and the people or teams you invite.
You choose when creating the repository and can change it later in Settings. Remember that making a repository public publishes its entire history — check it contains no secrets first.
The first files
Every repository should start with:
- README.md — what the project is, how to install and run it, and how to contribute. GitHub shows it on the repository’s front page. It’s written in Markdown (headings with
#, lists with-, code in backticks). - LICENSE — the legal terms for using your code. Without one, nobody is legally allowed to reuse it, even in a public repository. choosealicense.com explains the common options (MIT, Apache 2.0, GPL).
- .gitignore — from Ignoring files. GitHub offers templates when you create a repository.
Larger projects add CONTRIBUTING.md (how to contribute), CODE_OF_CONDUCT.md, SECURITY.md (how to report vulnerabilities) and templates for issues and pull requests in a .github/ folder.
Creating a repository and publishing a project
On the website
- Click + → New repository.
- Choose an owner (you or an organisation), a name and visibility.
- If you already have a local project, don’t add a README, licence or .gitignore here — leave the repository empty so your first push doesn’t conflict.
- GitHub shows the commands to connect your project:
git remote add origin git@github.com:asha/git-course-practice.git
git branch -M main
git push -u origin main(git branch -M main renames your current branch to main, in case it was called master.)
With the GitHub CLI
gh repo create git-course-practice --public --source=. --remote=origin --pushOne command creates the repository on GitHub, adds origin and pushes. Without arguments, gh repo create asks questions interactively.
To start from an existing GitHub repository instead, just clone it: gh repo clone asha/shop or git clone <url>.
Accounts, organisations and access
- A personal account owns repositories; you can invite collaborators with push access.
- An organisation is a shared account for a company or project, with teams and fine-grained roles (read, triage, write, maintain, admin).
- Your profile shows your public repositories and contribution activity — for many developers, it’s part of their CV. A repository named after your username with a README becomes your profile’s introduction.
Beyond the basics
You’ll meet several of these later in the course:
- GitHub Actions — automation (chapter 10).
- Releases — versioned downloads attached to tags (chapter 10).
- Dependabot and secret scanning — automatic security alerts and update pull requests (chapter 12).
- GitHub Pages — free static website hosting straight from a repository.
- Codespaces — cloud development environments in the browser.
- Discussions — a forum for questions and ideas.
- Copilot — AI assistance in the editor, in pull requests and on the website.
GitHub CLI: a quick tour
gh repo view --web # open the current repository in the browser
gh pr list # open pull requests
gh issue list # open issues
gh pr status # your pull requests and their review state
gh browse src/app.js # open a file on GitHubYou’ll use gh throughout this chapter, but everything also works in the web interface — use whichever you prefer.
Make it real: publish one of your own projects with a good README. A clean public repository is one of the best things you can show an employer.
Publish a project to GitHub
Create a small local project with a README, a .gitignore and an MIT licence, commit it, then publish it to a new public repository on your GitHub account with one GitHub CLI command that creates the repository, adds origin and pushes. (Use a throwaway name like git-course-practice — you can delete it later.) Finally open the repository page in your browser.
# Requires: a GitHub account and the GitHub CLI signed in (gh auth login)
mkdir git-course-practice && cd git-course-practice && git init -qb main
# 1. README, .gitignore and LICENSE
# 2. First commit
# 3. Create the GitHub repository, add origin and push — in one command
# 4. Open it in the browser# Requires: a GitHub account and the GitHub CLI signed in (gh auth login)
mkdir git-course-practice && cd git-course-practice && git init -qb main
# 1. README, .gitignore and LICENSE
cat > README.md <<'EOF'
# Git course practice
Exercises from the Git & GitHub course.
## Getting started
Clone the repository and open `index.html` in a browser.
EOF
printf "node_modules/\n.env\n*.log\n" > .gitignore
printf "MIT License\n\nCopyright (c) 2026 Asha Rao\n" > LICENSE # use the full MIT text from choosealicense.com
echo "<h1>Practice</h1>" > index.html
# 2. First commit
git add . && git commit -qm "Initial commit"
# 3. Create the GitHub repository, add origin and push — in one command
gh repo create git-course-practice --public --source=. --remote=origin --push \
--description "Practice repository for the Git & GitHub course"
# 4. Open it in the browser
gh repo view --webSummary
- GitHub hosts Git repositories and adds pull requests, issues, Actions, Projects, releases and security tools.
- A repository can be public (anyone can read) or private (only people you invite).
- A README, a licence and a .gitignore are the first files every repository should have.
- Publish an existing project with the web UI plus
git remote addandgit push, orgh repo create --source=. --push. - The GitHub CLI (
gh) brings pull requests, issues and more to your terminal.