GitHub Tutorial for Beginners
Learn GitHub step by step, from your first repository to pull requests, code review, GitHub Actions and GitHub Pages, with practical workflows for real team collaboration.
Browse all 30 lessons by stage
- Lessons
- 30
- Code examples
- 70
- Exercises
- 110
- Quiz questions
- 120
GitHub course at a glance
Who it's for
Beginners who want to share their code, students building a portfolio, first-time open-source contributors, and developers whose team has just moved to GitHub.
Prerequisites
Basic Git: commits, branches and pushing. Finish the Git tutorial beginner and intermediate stages first, or take them alongside this course.
What you need
A free GitHub account, Git on your computer and a web browser. The GitHub CLI (gh) and GitHub Desktop are optional extras covered in the lessons.
How long it takes
About two weeks for the beginner and intermediate lessons at an hour a day, and another two weeks for Actions, the advanced lessons and in-depth guides.
GitHub roadmap: beginner to advanced
Work through the 20 core chapters in the first three stages in order, then use the reference stages to go deeper. Each reference lesson links to its prerequisite and includes examples, practice and a quiz.
Beginner
Your account, repositories, Markdown, your profile, secure sign-in and moving code between your computer and GitHub.
- 1IntroductionWhat GitHub is, how it relates to Git, the words you'll see everywhere, and how to set up your account.
- 2RepositoriesCreate a repository on GitHub, write a helpful README, choose public or private, and add a .gitignore and licence.
Show all 6 lessonsShow fewer
- 3Markdown & READMEFormat README files, issues and pull requests with Markdown: headings, lists, links, images, code blocks, tables and task lists.
- 4Profile & PortfolioTurn your GitHub profile into a portfolio: a profile README, pinned repositories, a clear bio, good project READMEs and a contribution history that tells your story.
- 5SSH & AuthenticationProve who you are to GitHub from the terminal with an SSH key or a personal access token, and keep your account secure.
- 6Push, Pull & CloneConnect a local repository to GitHub, push your commits, pull others' changes and clone repositories.
Intermediate
Issues, pull requests, code review, forks, templates, Projects, gists and wikis: working together on GitHub.
- 7IssuesReport bugs and plan work with issues, labels, assignees and milestones, and link issues to commits and pull requests.
- 8Pull RequestsPropose changes from a branch, review them, respond to feedback and merge with a pull request.
Show all 7 lessonsShow fewer
- 9Code ReviewReview pull requests on GitHub: comment on lines, suggest changes, approve or request changes, and give feedback that helps.
- 10Forks & Open SourceFork a repository, keep your fork in sync with the original, and contribute to open-source projects through pull requests.
- 11Templates & Community FilesGuide contributors with issue and pull request templates, start new projects quickly from template repositories, and add the community files every healthy project has.
- 12Projects & DiscussionsPlan and track work with GitHub Projects boards, tables and roadmaps, automate status changes, and use Discussions and issue forms.
- 13Gists & WikisShare code snippets and notes with Gists, write longer project documentation with a repository wiki, and decide when docs belong in the repository itself.
Advanced
GitHub Pages, Actions, releases, organizations, security, Codespaces and the GitHub CLI: publishing, automating and administering like a professional.
- 14GitHub PagesPut an HTML, CSS and JavaScript website online straight from a repository, and update it with every push.
- 15GitHub ActionsAutomate testing, checks and deployments with GitHub Actions workflows written in YAML.
Show all 7 lessonsShow fewer
- 16ReleasesPublish versions of your project with GitHub Releases: tags, semantic version numbers, release notes, downloadable files and automation.
- 17Organizations & TeamsRun shared projects in a GitHub organization: members and roles, teams with repository access, outside collaborators, rulesets across repositories, and good habits for joining and leaving.
- 18SecurityKeep your repositories safe with branch protection, Dependabot, secret scanning, code scanning, collaborator permissions and a security policy.
- 19CodespacesStart a complete development environment in the cloud with GitHub Codespaces, configure it with a devcontainer.json, forward ports to preview your app, and manage usage and costs.
- 20GitHub CLIUse the gh command to create repositories, open and merge pull requests, manage issues, watch workflow runs and script GitHub from the terminal.
Review and repository rules
CODEOWNERS for routing reviews, and rulesets with required reviews, status checks and merge queues.
- 21GitHub CODEOWNERS Patterns and Review RequirementsDefine GitHub code ownership, reason about the last matching pattern and separate automatic review requests from enforced code-owner approval requirements.
- 22GitHub Repository Rulesets and Merge Queue ChecksPlan GitHub rulesets and merge queues, identify required checks and trigger Actions on merge_group so combined changes are evaluated before merging.
Workflow reference
Actions contexts and expressions, reusable workflows, caches and artifacts, token permissions and fork security, and environments with OIDC deployment.
- 23GitHub Actions Contexts, Expressions and Job OutputsLearn Actions contexts and expressions, pass job outputs explicitly and handle boolean strings and user-controlled values safely in runner scripts.
- 24GitHub Reusable Workflows with Typed Inputs and OutputsBuild a reusable GitHub workflow with workflow_call, typed inputs and outputs, then call it at job level with explicit permissions and contracts.
Show all 5 lessonsShow fewer
- 25GitHub Actions Dependency Caches and Workflow ArtifactsChoose caches for reusable inputs and artifacts for produced results, design cache keys and pass a named report between GitHub Actions jobs.
- 26GitHub Actions Permissions and Untrusted Pull RequestsSet explicit Actions token permissions, understand fork pull-request trust and keep privileged metadata automation separate from executing contributor code.
- 27GitHub Environments and OIDC Deployment IdentityConnect environment protection to OIDC job identity, inspect audience and subject claims and design a provider trust policy without storing a cloud key.
Project management and services
The REST API with pagination and rate limits, issue forms for triage, and publishing container images to GitHub Packages.
- 28GitHub REST API Pagination with Bounded ClientsFollow GitHub REST Link pagination, bound page traversal and handle issue-versus-pull-request results, version headers and rate-limit responses deliberately.
- 29GitHub Issue Forms for Useful Reports and TriageBuild a GitHub issue form with required reproduction fields, existing labels and a practical triage process that turns reports into reviewable next steps.
What is GitHub?
GitHub is a website for storing and sharing Git repositories. It gives every project a home online, where you can back up your code, show your work to employers, collaborate with teammates and contribute to open-source projects used by millions of people.
GitHub is built on Git. Git tracks changes on your own computer; GitHub hosts a copy of the repository on the internet and adds tools around it: pull requests for proposing and reviewing changes, issues for tracking bugs and ideas, and GitHub Pages for publishing websites straight from a repository.
This course has three stages. The beginner stage creates your account and first repository, teaches the Markdown used for README files, builds a profile that shows your best work, connects Git securely with SSH keys or tokens, and moves code between your computer and GitHub. The intermediate stage is about working with other people: issues, pull requests, code review, forks for open-source contributions, templates and community files, planning with Projects, and sharing with gists and wikis. The advanced stage covers publishing, automation and administration: websites with GitHub Pages, tests and deployments with GitHub Actions, versioned releases, organizations and teams, security features, cloud development with Codespaces and the gh command-line tool.
It's the natural next step after the Git tutorial, and the perfect way to publish the pages you build in the HTML and CSS courses.
How to follow this course
Work through the 20 core lessons in order, because each one builds on the last. After that, the in-depth guides cover what growing teams and projects need. The review and repository rules guides cover CODEOWNERS and rulesets with required checks and merge queues. The workflow guides go deeper into GitHub Actions: contexts and expressions, reusable workflows, caches and artifacts, token permissions and fork safety, and deployment environments with OIDC. The project management and services guides cover the REST API with pagination and rate limits, issue forms and GitHub Packages. Each guide lists the core lessons to finish first.
What you will learn
11 practical skills, built one lesson at a time
- Explain what GitHub is and how it relates to Git
- Create a repository and write a clear README in Markdown
- Build a GitHub profile that works as a portfolio
- Connect securely with SSH keys or tokens, then push, pull and clone
- Track work with issues and plan it with GitHub Projects
- Propose, review and merge changes with pull requests
- Contribute to open-source projects through forks, guided by templates and community files
- Publish a website with GitHub Pages
- Automate tests and deployments with GitHub Actions
- Publish versioned releases and manage organizations, teams and security settings
- Develop in the cloud with Codespaces and work faster with the gh CLI
Practise GitHub your way
Learning sticks when you use it. Pick a mode.
GitHub Exercises
Fill in blanks, predict output and fix broken code with instant feedback.
110 exercisesGitHub Quiz
5, 10 or 20 questions with a timer and explanations after every answer.
120 questionsGitHub Cheat Sheet
Every important piece of syntax on one printable page.
Open cheat sheetLearning Paths
See where GitHub fits in a complete roadmap, and what to learn next.
View learning pathsGitHub FAQ
Do I need to learn Git before GitHub?
It helps a lot. GitHub stores Git repositories, so knowing how commits and branches work makes everything on GitHub make sense. The first lessons of our Git tutorial take about an hour and cover all you need.
Is my code public on GitHub?
Only if you choose. When you create a repository you pick public, which anyone can see, or private, which only you and the people you invite can see. You can change it later in the repository's settings.
Can I use GitHub without the command line?
Yes. You can create files, edit them and make commits right on the GitHub website, and the GitHub Desktop app gives you buttons for push, pull and branches. This course shows the commands because they work everywhere, and mentions the website buttons as you go.
Why do employers look at GitHub profiles?
A GitHub profile shows real projects, how you write code and how you work with others through pull requests and issues. For beginners, a few small, well-documented projects with clear README files can say more than a CV.
What is GitHub Actions used for?
GitHub Actions runs automated workflows in the cloud whenever something happens in your repository, such as a push or a new pull request. It's most often used to run tests, check code style and deploy websites. The Actions lesson walks through writing your first workflow.
How do I make my first open-source contribution?
Find a project you use, read its CONTRIBUTING.md, and look for issues labelled good first issue. Fork the repository, make a small change on a branch and open a pull request. The forks lesson covers every step.
Is this GitHub course free?
Yes. All 20 core lessons, the 10 in-depth guides, the exercises, the quiz and the cheat sheet are free. A free GitHub account covers everything the lessons use, including public repositories, Pages and Actions minutes.
Is GitHub free to use?
Yes, for most people. Free accounts get unlimited public and private repositories, GitHub Pages and a monthly allowance of Actions minutes for private repositories. Paid plans add features for teams and companies.
What is a pull request?
A pull request proposes merging the changes on one branch into another. It shows the differences, lets teammates review and comment line by line, runs automated checks, and records the discussion with the merge.
How do I host a website on GitHub for free?
Use GitHub Pages: push your HTML, CSS and JavaScript to a repository, then enable Pages in the repository settings. Your site appears at username.github.io/repository, and the GitHub Pages lesson walks through each step.
More tutorials
SQL
The language for asking databases questions and keeping data organised.
Start SQLMongoDB
The popular document database for flexible, JSON-like data at any scale.
Start MongoDBGit
Track every change to your code and never lose work again.
Start GitHTML
The skeleton of every web page. Start here.
Start HTMLCSS
Colours, fonts, spacing and layouts that make pages beautiful.
Start CSSJavaScript
The programming language that makes web pages interactive.
Start JavaScript