Github Foundations · Free Practice Question Medium
Question 24
When creating a new repository, what are the recommended files that should be included? (select five)
-
A
a
CODEOWNERSfile to define individuals or teams that are responsible for code in a repository -
B
compiled code or build output files related to the project
-
C
a
.gitignorethat lists files and directories that should be ignored by Git -
D
a
READMEfile to tell other people why your project is useful, what they can do with your project, and how they can use it -
E
a license that communicates how users can use the files contained in the repository
-
F
any passwords, API keys, or access tokens needed to compile and launch the application on a public cloud platform
-
G
a contributing file to document the guidelines on how people should contribute to your project
Reveal correct answers
Correct answers: A, C, D, E, G
Explanation
In a public repository, you should include files that provide essential information about the project, help contributors understand the codebase, and maintain transparency in the development process. Including these files enhances the accessibility, collaboration, and transparency of your public repository. Always ensure that you comply with licensing requirements and clearly communicate the terms under which others can use and contribute to your project.
********************
WRONG ANSWERS:
Avoid adding files containing sensitive information such as passwords, API keys, access tokens, or any confidential data.
Compiled code or build output files should be excluded. These can be generated locally when building the project.
A.
The CODEOWNERS file specifies individuals or teams responsible for reviewing and approving changes to specific parts of the codebase. It helps distribute ownership and accountability within the project.
B. Including compiled code or build output files in your repository is generally not recommended. These files can be generated locally or through a CI/CD pipeline and do not need to be stored in the repository. Keeping the repository clean and focused on source code is best practice.
C.
The .gitignore file is used to specify files and directories that Git should ignore when tracking changes in the repository. It helps prevent sensitive or unnecessary files from being included in version control.
D.
A README file is crucial for providing essential information about your project to potential users and contributors. It serves as the first point of contact for anyone visiting your repository, explaining the purpose and usage of the project.
E. Including a license file in your repository is essential to communicate the terms under which others can use, modify, and distribute your project. It helps protect your work and clarifies how others can interact with your code.
F. It is not recommended to include passwords, API keys, or access tokens in your repository, especially if it is a public repository. Keeping sensitive information secure is crucial to protect your project and data from unauthorized access.
G. A contributing file outlines the guidelines and expectations for contributing to the project. It helps maintain a healthy and collaborative community around the project by setting clear rules for participation.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
