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?
AThe README in the .github folder
BThe README in the root folder, because the root always wins
CWhichever README was changed most recently
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.
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?
APublic repositories are open source by default, so the company may reuse it
BGitHub applies the MIT license to any public repository that has none
CNo one may even view or fork the repository until a license is added
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.
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?
AA CODEOWNERS file listing the maintainers who review contributions
BA LICENSE file describing how the code may be reused
CA CONTRIBUTING file in the root, docs or .github folder
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.
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?
AThe Pulse view under the Insights tab
BThe Traffic graph under the repository's Insights tab
CThe Contributors graph under the Insights tab
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.
A team finishes a project and plans to archive its repository instead of deleting it. Which two statements describe what happens? (Choose TWO.)
AIts issues, pull requests, code and wiki become read-only for all users
BOwners can keep adding and removing collaborators and teams while it is archived
CCollaborators with write access can still push to branches
DIt can be unarchived later if the team needs to make changes
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.
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?
AA GitHub Packages registry, with each firmware version published as a package version
BGit LFS, which tracks the file in the repository through a pointer file
CUploading the file through the browser instead of the command line
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.
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?
ASelect Template repository in the repository's settings
BAdd a TEMPLATE.md file at the root of the repository describing its layout
CArchive the repository so it can be copied
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.
What does a repository's social media preview image change?
AThe image used as the owner's profile picture
BThe image shown when someone shares a link to the repository
CThe README's header
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.
Which library does GitHub use to work out the languages shown on a repository's main page?
ADependabot
BGit LFS
CLinguist
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.
What does a README file typically tell visitors to a repository?
AWho may review each file
BWhat the project does and how to get started
CThe legal terms under which others may reuse the code
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.