Skip to content

GH-900 · Domain 2: Work with GitHub repositories · 13% of the exam

Task 2.1: Repository management

A repository's key files (README, LICENSE, CONTRIBUTING, CODEOWNERS, SECURITY), templates and branches, adding and managing files, insights, stars and feature previews, and keeping a repository in good shape.

Study it

  • README, LICENSE, CONTRIBUTING, CODEOWNERS and SECURITY: a repository's key files

    Lesson coming

  • Creating repositories from templates, and branches, files and large files

    Lesson coming

  • Repository insights, stars, feature preview and dependency insights

    Lesson coming

  • Maintaining a repository: rulesets, topics, releases and archiving

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the GitHub documentation page that proves it.

Question 1 · choose 1

A repository has one README.md in its .github folder and an older README.md in its root folder. A maintainer wants to know which file visitors see on the repository's main page. Which one does GitHub show?

  1. AThe README in the .github folder
  2. BThe README in the root folder, because the root always wins
  3. CWhichever README was changed most recently
  4. DNeither, until one of the two files is deleted
Show the answer and why
  • AThe README in the .github folder

    Correct

    When there is more than one README, GitHub looks in .github first, then the root, then docs.

  • BThe README in the root folder, because the root always wins

    Incorrect

    The root comes second, after the .github folder.

  • CWhichever README was changed most recently

    Incorrect

    The choice follows a fixed order of locations, not the date of the last change.

  • DNeither, until one of the two files is deleted

    Incorrect

    GitHub shows one of them; it doesn't wait for a conflict to be removed.

If you put a README file in your repository's hidden .github, root or docs directory, GitHub recognizes it and surfaces it to visitors. If a repository contains more than one README, the file shown is chosen in this order: the .github directory, then the root directory, and finally the docs directory.

Question 2 · choose 1

A developer publishes a utility in a public repository but adds no license file. A company asks whether it may copy the code into its own product. Which statement is accurate?

  1. APublic repositories are open source by default, so the company may reuse it
  2. BGitHub applies the MIT license to any public repository that has none
  3. CNo one may even view or fork the repository until a license is added
  4. DDefault copyright applies: others can view and fork it on GitHub but not reuse the code
Show the answer and why
  • APublic repositories are open source by default, so the company may reuse it

    Incorrect

    Making a repository public doesn't license the code; a license is needed for that.

  • BGitHub applies the MIT license to any public repository that has none

    Incorrect

    GitHub applies no license; without one, default copyright laws apply.

  • CNo one may even view or fork the repository until a license is added

    Incorrect

    GitHub's terms let other users view and fork public repositories.

  • DDefault copyright applies: others can view and fork it on GitHub but not reuse the code

    Correct

    Without a license, the author keeps all rights; GitHub's terms only let other users view and fork a public repository.

You are under no obligation to choose a license, but without one the default copyright laws apply: you retain all rights, and no one may reproduce, distribute or create derivative works from your work. Under GitHub's Terms of Service, other users can still view and fork a public repository. For a project to truly be open source, add a license.

Question 3 · choose 1

A maintainer keeps receiving pull requests without tests and issues without reproduction steps. She wants contributors to see the project's rules at the moment they open an issue or a pull request. Which file should she add?

  1. AA CODEOWNERS file listing the maintainers who review contributions
  2. BA LICENSE file describing how the code may be reused
  3. CA CONTRIBUTING file in the root, docs or .github folder
  4. DA CITATION.cff file describing the project
Show the answer and why
  • AA CODEOWNERS file listing the maintainers who review contributions

    Incorrect

    CODEOWNERS assigns reviewers; it doesn't show guidelines to contributors.

  • BA LICENSE file describing how the code may be reused

    Incorrect

    A license sets usage rights, not contribution rules.

  • CA CONTRIBUTING file in the root, docs or .github folder

    Correct

    GitHub shows a link to the contribution guidelines when someone opens a pull request or creates an issue.

  • DA CITATION.cff file describing the project

    Incorrect

    A citation file tells people how to cite the work, not how to contribute.

Contribution guidelines in a CONTRIBUTING file, in the repository's root, docs or .github folder, tell people how to contribute. When someone opens a pull request or creates an issue, they see a link to the file, and GitHub also surfaces it in a Contributing tab and in the repository sidebar.

Question 4 · choose 1

A maintainer with push access wants to learn which websites send visitors to her public repository and which of its pages are most viewed. Where should she look?

  1. AThe Pulse view under the Insights tab
  2. BThe Traffic graph under the repository's Insights tab
  3. CThe Contributors graph under the Insights tab
  4. DThe list of stargazers for the repository, sorted by most recent
Show the answer and why
  • AThe Pulse view under the Insights tab

    Incorrect

    Pulse doesn't report referring sites or page views.

  • BThe Traffic graph under the repository's Insights tab

    Correct

    Traffic shows referring sites and popular content, along with visitors and clones for the past 14 days.

  • CThe Contributors graph under the Insights tab

    Incorrect

    The contributors graph shows who committed, not where visitors come from.

  • DThe list of stargazers for the repository, sorted by most recent

    Incorrect

    Stargazers are people who starred it, not traffic sources.

Anyone with push access to a repository can view its traffic graph under Insights: full clones, visitors from the past 14 days, referring sites and popular content. Referring sites and popular content are ordered by views and unique visitors.

Question 5 · choose 2

A team finishes a project and plans to archive its repository instead of deleting it. Which two statements describe what happens? (Choose TWO.)

  1. AIts issues, pull requests, code and wiki become read-only for all users
  2. BOwners can keep adding and removing collaborators and teams while it is archived
  3. CCollaborators with write access can still push to branches
  4. DIt can be unarchived later if the team needs to make changes
  5. EIt disappears from search results on GitHub
Show the answer and why
  • AIts issues, pull requests, code and wiki become read-only for all users

    Correct

    Archiving makes the repository read-only and signals it is no longer maintained.

  • BOwners can keep adding and removing collaborators and teams while it is archived

    Incorrect

    Once a repository is archived, collaborators and teams can't be added or removed.

  • CCollaborators with write access can still push to branches

    Incorrect

    Nobody can push to an archived repository.

  • DIt can be unarchived later if the team needs to make changes

    Correct

    Unarchiving restores normal editing.

  • EIt disappears from search results on GitHub

    Incorrect

    Archived repositories can still be searched.

Archiving makes a repository read-only for all users and indicates it is no longer actively maintained. Its issues, pull requests, code, labels, milestones, projects, wiki, releases, branches and comments become read-only; contributors can only fork or star it. You can unarchive it to make changes, and archived repositories can still be found in search. GitHub recommends closing issues and pull requests and updating the README first.

Question 6 · choose 1

A hardware team must keep a 300 MB firmware image versioned in its repository next to the code, so that every commit references the right version. A normal git push of the file is rejected. What should the team use?

  1. AA GitHub Packages registry, with each firmware version published as a package version
  2. BGit LFS, which tracks the file in the repository through a pointer file
  3. CUploading the file through the browser instead of the command line
  4. DSplitting the repository so the file lives in its own repository
Show the answer and why
  • AA GitHub Packages registry, with each firmware version published as a package version

    Incorrect

    A package lives in a registry for a package manager, so the commits in the repository wouldn't track the image.

  • BGit LFS, which tracks the file in the repository through a pointer file

    Correct

    GitHub blocks files over 100 MiB; Git LFS is the way to track files beyond that limit.

  • CUploading the file through the browser instead of the command line

    Incorrect

    Uploading through the browser doesn't lift GitHub's file size limit.

  • DSplitting the repository so the file lives in its own repository

    Incorrect

    GitHub still blocks the file there, because the limit is per file.

GitHub warns about files larger than 50 MiB and blocks files larger than 100 MiB. To track files beyond this limit, use Git Large File Storage, which stores a pointer file in the repository and keeps the actual file elsewhere, so each commit points to the right version of the file.

Question 7 · choose 1

A platform team has a repository with the folder layout, linting setup and workflow files every new service should start from. It wants teams to create new repositories from it with one click. What should the team do?

  1. ASelect Template repository in the repository's settings
  2. BAdd a TEMPLATE.md file at the root of the repository describing its layout
  3. CArchive the repository so it can be copied
  4. DEnable GitHub Pages for the repository
Show the answer and why
  • ASelect Template repository in the repository's settings

    Correct

    Marking the repository as a template lets anyone with access generate new repositories from it.

  • BAdd a TEMPLATE.md file at the root of the repository describing its layout

    Incorrect

    No special file turns a repository into a template.

  • CArchive the repository so it can be copied

    Incorrect

    Archiving doesn't let anyone generate new repositories from it.

  • DEnable GitHub Pages for the repository

    Incorrect

    Pages publishes a site; it doesn't let others generate repositories.

You can make an existing repository a template so that you and others can generate new repositories with the same directory structure, branches and files. To create a template repository, create a repository, then under Settings select Template repository.

Question 8 · choose 1

On GitHub, how can a maintainer remove an entire folder of outdated examples in one step?

  1. AArchive the repository
  2. BRename the folder to outdated-examples
  3. CRemove the folder's entry from the README's table of contents
  4. DBrowse to the folder and choose Delete directory
Show the answer and why
  • AArchive the repository

    Incorrect

    Archiving affects the whole repository and removes no files.

  • BRename the folder to outdated-examples

    Incorrect

    Renaming a folder keeps all of its files.

  • CRemove the folder's entry from the README's table of contents

    Incorrect

    The README only describes the project.

  • DBrowse to the folder and choose Delete directory

    Correct

    GitHub can delete an individual file or a whole directory.

You can delete an individual file or an entire directory, including all its files, on GitHub. Deleted content stays in the repository's Git history.

Question 9 · choose 1

What does a repository's social media preview image change?

  1. AThe image used as the owner's profile picture
  2. BThe image shown when someone shares a link to the repository
  3. CThe README's header
  4. DThe favicon shown in browser tabs for the repository's GitHub Pages site
Show the answer and why
  • AThe image used as the owner's profile picture

    Incorrect

    Profile pictures are set on the account.

  • BThe image shown when someone shares a link to the repository

    Correct

    The preview image identifies the project when links are shared.

  • CThe README's header

    Incorrect

    The README is a file in the repository.

  • DThe favicon shown in browser tabs for the repository's GitHub Pages site

    Incorrect

    Pages sites are configured separately.

You can customize the image shown on social media platforms when someone links to your repository. Until you add one, links show basic repository information and the owner's avatar.

Question 10 · choose 1

Which library does GitHub use to work out the languages shown on a repository's main page?

  1. ADependabot
  2. BGit LFS
  3. CLinguist
  4. DPulse
Show the answer and why
  • ADependabot

    Incorrect

    Dependabot keeps dependencies up to date.

  • BGit LFS

    Incorrect

    Git LFS stores large files.

  • CLinguist

    Correct

    GitHub uses the open source Linguist library to detect file languages.

  • DPulse

    Incorrect

    Pulse doesn't detect languages.

GitHub uses the open source Linguist library to determine file languages for syntax highlighting and repository statistics. Linguist only works for repositories with fewer than 100,000 files.

Question 11 · choose 1

What does a README file typically tell visitors to a repository?

  1. AWho may review each file
  2. BWhat the project does and how to get started
  3. CThe legal terms under which others may reuse the code
  4. DThe list of open security alerts
Show the answer and why
  • AWho may review each file

    Incorrect

    That is the job of CODEOWNERS.

  • BWhat the project does and how to get started

    Correct

    A README communicates the key information about a project.

  • CThe legal terms under which others may reuse the code

    Incorrect

    Those belong in a license.

  • DThe list of open security alerts

    Incorrect

    Alerts appear in the security features, not the README.

A README is often the first thing a visitor sees. It typically explains what the project does, why it is useful, how to get started, where to get help, and who maintains and contributes to it.

Practise domain 2 →Practise all domains →