Assess your skills in creating, configuring, and handling repositories within version control tools. This quiz focuses on repository setup, branching, collaboration, and access management for an optimized development workflow.
Which of the following methods allows you to create a new repository while also initializing it with a README file for documentation?
Explanation: Choosing to initialize a repository with a README during creation adds a documentation file automatically, making it easier to describe your project. Importing an existing repository transfers its files but does not specifically generate a README. Cloning copies an existing repository to your computer and doesn't create a README by itself. Forking creates a separate copy of someone else's repository, but doesn't initialize a README for you unless one already exists.
What is the most commonly used default branch name when creating a new repository in modern version control systems?
Explanation: The term 'main' has been adopted as the most common default branch name, reflecting updated conventions for inclusivity. 'Master' was previously the standard but is being phased out. 'Primary' and 'root' are not widely used as default branch names and would generally require manual configuration if desired.
If you want someone to contribute to your repository by pushing changes directly, which permission level should you grant them?
Explanation: Granting 'Write' permissions allows collaborators to push changes directly to the repository, supporting smooth teamwork. 'Read' only permits viewing and cloning without making changes. 'Owner' is inappropriate for general contributors as it provides full administrative control. 'Audit' is not a standard permission level and does not enable contributions.
In a scenario where you want to develop a new feature without affecting the main codebase, which action would be the best practice?
Explanation: Creating a new branch allows for isolated development, minimizing the risk of disrupting the stable main branch. Overwriting or committing directly to the main branch can introduce errors or instability. Deleting the repository is unnecessary and would erase existing progress, which is not a good workflow practice.
If two collaborators edit the same line of a file and try to merge their branches, what situation is most likely to occur?
Explanation: When the same lines are edited in different branches, a merge conflict arises and must be resolved manually to ensure clarity. An empty commit does not result from such conflicts. Sometimes merges occur automatically, but not when there are conflicting changes. Rewriting history is not a default response; instead, users are prompted to address the conflict.