GitHub110 exercises

GitHub Exercises with Answers

Practise GitHub with 110 interactive exercises: multiple choice, fill-in-the-blank, output prediction and debugging. Every exercise gives instant feedback, a hint and the full solution.

Score0/ 110

1Introduction

Read the lesson
Fill in the blankseasyIntroduction

Complete the GitHub CLI command that signs you in.

gh  
Multiple choiceeasyIntroduction

What is a fork on GitHub?

Multiple choicemediumIntroduction

Which statement about Git and GitHub is true?

Predict the outputmediumIntroduction

What does https://github.com/ada/notes/pull/12 point to?

Multiple choicemediumIntroduction

What's the main difference between Git and GitHub?

2Repositories

Read the lesson
Fill in the blankseasyRepositories

Complete the Markdown so it shows a main heading and a bold word.

 Weather App
A **** app that shows the forecast.
Multiple choiceeasyRepositories

Who can see a private repository?

Multiple choicemediumRepositories

Why add a licence such as MIT to a public project?

Predict the outputmediumRepositories

What happens to a line ## Installation in a README?

Multiple choicemediumRepositories

Which visibility lets only you and invited people see a repository?

3Markdown & README

Read the lesson
Fill in the blankseasyMarkdown & README

Complete the Markdown for a second-level heading.

 Installation
Multiple choiceeasyMarkdown & README

Which Markdown makes text bold?

Multiple choicemediumMarkdown & README

Which line is a correct Markdown link?

Predict the outputmediumMarkdown & README

What does - [ ] Write tests show in a GitHub issue?

Multiple choicehardMarkdown & README

How do you get syntax highlighting for a block of Python code?

4Profile & Portfolio

Read the lesson
Fill in the blankseasyProfile & Portfolio

For the user ada, what must the special profile repository be called?

Repository name: 
Multiple choiceeasyProfile & Portfolio

How many repositories can you pin to your profile?

Multiple choicemediumProfile & Portfolio

What's the most effective thing to add to a project README?

Multiple choicemediumProfile & Portfolio

Why might your commits not appear on your contribution graph?

Multiple choicehardProfile & Portfolio

What should you do with old experiments you don't want to be judged by?

5SSH & Authentication

Read the lesson
Fill in the blankseasySSH & Authentication

Complete the command that creates a new SSH key.

 -t ed25519 -C "sam@example.com"
Multiple choiceeasySSH & Authentication

Which file do you add to GitHub?

Multiple choicemediumSSH & Authentication

Which address is an SSH remote?

Predict the outputmediumSSH & Authentication

You run ssh -T git@github.com and see "Hi ada! You've successfully authenticated". What does it mean?

Multiple choicehardSSH & Authentication

You cloned with HTTPS but want to use SSH from now on. What's the best command?

6Push, Pull & Clone

Read the lesson
Fill in the blankseasyPush, Pull & Clone

Complete the command that sends main to GitHub for the first time and links it.

git   origin main
Multiple choiceeasyPush, Pull & Clone

What does git clone <url> do?

Multiple choicemediumPush, Pull & Clone

What's the difference between git fetch and git pull?

Predict the outputmediumPush, Pull & Clone

You run git push and see "rejected (fetch first)". What's the usual fix?

Multiple choicemediumPush, Pull & Clone

What does git fetch do that git pull doesn't?

Fill in the blankseasyIssues

Complete the line so that merging the pull request closes issue 7.

 
Multiple choiceeasyIssues

What makes a good issue title?

Predict the outputmediumIssues

What does - [ ] Write tests become in an issue?

Multiple choicemediumIssues

Which filter shows open issues labelled as bugs?

Multiple choicemediumIssues

Which line in a pull request description closes issue 8 when the PR is merged?

8Pull Requests

Read the lesson
Fill in the blankseasyPull Requests

Complete the command that pushes a new branch for a pull request.

git push   add-footer
Multiple choiceeasyPull Requests

What is a pull request?

Multiple choicemediumPull Requests

A reviewer asks for a change on your open PR. What do you do?

Predict the outputmediumPull Requests

What happens when a PR whose description contains Closes #8 is merged?

Multiple choicemediumPull Requests

How do you update a pull request after review feedback?

9Code Review

Read the lesson
Fill in the blankseasyCode Review

Complete the command that downloads pull request 15 to review it locally.

gh pr  15
Multiple choiceeasyCode Review

Which tab shows a pull request's line-by-line changes?

Multiple choicemediumCode Review

What does a suggestion comment let the author do?

Multiple choicemediumCode Review

Which review result blocks merging until it's addressed (on protected branches)?

Multiple choicehardCode Review

What does a CODEOWNERS file do?

10Forks & Open Source

Read the lesson
Fill in the blankseasyForks & Open Source

Complete the command that adds the original project as a remote.

git remote add  https://github.com/open-kitchen/recipe-api.git
Multiple choiceeasyForks & Open Source

What is a fork?

Multiple choicemediumForks & Open Source

After forking and cloning, what does origin point to?

Multiple choicemediumForks & Open Source

Which commands bring the original project's new commits into your local main?

Multiple choicehardForks & Open Source

When opening a PR from a fork, what should the base repository be?

11Templates & Community Files

Read the lesson
Fill in the blankseasyTemplates & Community Files

Complete the path for a pull request template.

.github/
Multiple choiceeasyTemplates & Community Files

Where do issue templates go?

Multiple choicemediumTemplates & Community Files

What does blank_issues_enabled: false do?

Multiple choicemediumTemplates & Community Files

What's the difference between a fork and a repository created from a template?

Multiple choicehardTemplates & Community Files

How can an organisation give all its repositories a default CODE_OF_CONDUCT.md?

12Projects & Discussions

Read the lesson
Fill in the blankseasyProjects & Discussions

Complete the folder where issue forms are stored.

.github//bug_report.yml
Multiple choiceeasyProjects & Discussions

Which project view shows work as columns of cards?

Multiple choicemediumProjects & Discussions

Where should a question like "How do I install this?" usually go?

Multiple choicemediumProjects & Discussions

What does the "Pull request merged" workflow do?

Multiple choicehardProjects & Discussions

Why use a custom Priority field instead of priority labels?

13Gists & Wikis

Read the lesson
Fill in the blankseasyGists & Wikis

Complete the command that creates a public gist.

gh gist create notes.md --
Multiple choiceeasyGists & Wikis

What is a secret gist?

Multiple choicemediumGists & Wikis

Why give a gist file an extension like .sql?

Multiple choicemediumGists & Wikis

Which wiki page appears as a menu on every page?

Multiple choicehardGists & Wikis

Where should installation steps that change with the code usually live?

14GitHub Pages

Read the lesson
Fill in the blankseasyGitHub Pages

Complete the name of the file GitHub Pages uses as the home page.

.html
Multiple choiceeasyGitHub Pages

Which of these can GitHub Pages host?

Predict the outputmediumGitHub Pages

User ada publishes the repository recipes with GitHub Pages. What's the site's address?

Multiple choicemediumGitHub Pages

How do you update a published GitHub Pages site?

Multiple choicehardGitHub Pages

Your Pages site shows a 404. What should you check first?

15GitHub Actions

Read the lesson
Fill in the blankseasyGitHub Actions

Complete the folder where workflow files live.

.github//ci.yml
Multiple choiceeasyGitHub Actions

What does on: pull_request do?

Multiple choicemediumGitHub Actions

What's the difference between uses and run?

Predict the outputmediumGitHub Actions

A matrix lists 3 Node versions and 2 operating systems. How many jobs run?

Multiple choicehardGitHub Actions

How should a workflow use an API key?

Fill in the blankseasyReleases

Complete the command that creates a release with automatically written notes.

gh release create v1.0.0 --
Predict the outputeasyReleases

Version 2.3.4 gets a bug fix only. What's the next version?

Predict the outputmediumReleases

Version 2.3.4 removes a function that people relied on. What's the next version?

Multiple choicemediumReleases

What does a pre-release mean?

Multiple choicehardReleases

What does on: push: tags: ["v*"] do in a workflow?

17Organizations & Teams

Read the lesson
Fill in the blankseasyOrganizations & Teams

Complete the CODEOWNERS line so the docs team owns the docs folder.

/docs/ @acme/
Multiple choiceeasyOrganizations & Teams

Why use an organization instead of a personal account for a company's code?

Multiple choicemediumOrganizations & Teams

Which repository role lets someone push branches and merge pull requests?

Multiple choicemediumOrganizations & Teams

What is an outside collaborator?

Multiple choicehardOrganizations & Teams

What advantage do organization rulesets have over per-repository branch protection?

Fill in the blankseasySecurity

Complete the name of the file that tells people how to report vulnerabilities.

.md
Multiple choiceeasySecurity

Which feature blocks a push that contains a secret?

Multiple choicemediumSecurity

What do branch protection rules let you require?

Multiple choicemediumSecurity

Which role can manage issues and pull requests but not push code?

Multiple choicehardSecurity

An API key was pushed to a public repository an hour ago. What should you do first?

19Codespaces

Read the lesson
Fill in the blankseasyCodespaces

Complete the path of the dev container configuration file.

.devcontainer/
Multiple choiceeasyCodespaces

What is a codespace?

Multiple choicemediumCodespaces

Which devcontainer.json setting runs npm install after the container is created?

Multiple choicemediumCodespaces

What happens to a codespace you stop?

Multiple choicehardCodespaces

How should an API key be made available inside a codespace?

20GitHub CLI

Read the lesson
Fill in the blankseasyGitHub CLI

Complete the command that signs GitHub CLI in to your account.

gh auth 
Multiple choiceeasyGitHub CLI

Which command opens a pull request using your commit messages?

Multiple choicemediumGitHub CLI

What does gh pr checkout 42 do?

Multiple choicemediumGitHub CLI

Which command follows a running Actions workflow until it finishes?

Multiple choicehardGitHub CLI

How can you call a GitHub API endpoint that has no dedicated gh command?

21GitHub CODEOWNERS Patterns and Review Requirements

Read the lesson

In the main ownership file, which teams own docs/security/access.md?

22GitHub Repository Rulesets and Merge Queue Checks

Read the lesson

Which result exposes the version disagreement in the compatibility exercise?

23GitHub Actions Contexts, Expressions and Job Outputs

Read the lesson

Which conversion gives the practice program's raw false text boolean meaning?

24GitHub Reusable Workflows with Typed Inputs and Outputs

Read the lesson

With the practice caller's target set to tests, what should its show job print?

25GitHub Actions Dependency Caches and Workflow Artifacts

Read the lesson

In the practice program, why is changed input: false printed?

26GitHub Actions Permissions and Untrusted Pull Requests

Read the lesson

Why can the modeled label job not publish a package?

27GitHub Environments and OIDC Deployment Identity

Read the lesson

Why does the local policy model reject production context?

28GitHub REST API Pagination with Bounded Clients

Read the lesson

Why is record2 absent from issue IDs in the main fixture?

29GitHub Issue Forms for Useful Reports and Triage

Read the lesson

Why does the practice program still print confirmed defect: false after completing the fields?

30GitHub Container Registry Packages and Image Identity

Read the lesson

After the practice model moves latest, what still identifies its original modeled content?

Next steps