During the setup of a new internal Git server, you must create an empty repository named inventory.git inside /srv/git so that developers can push to it over SSH. The organization's policy also demands that the initial branch be called main rather than the historical master. Which single git init command meets both requirements?
The only command that satisfies the requirements in one step is the one that combines --bare (to create a repository without a working tree that others can push to) with --initial-branch=main (to name the first branch main). Using --branch is invalid because the long option is --initial-branch or the short -b. Omitting --bare creates a working-tree repository, which is unsuitable for a central push target, and running a second command to rename the branch breaks the "single command" constraint.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a bare repository in Git?
Open an interactive chat with Bash
What is the difference between `--branch` and `--initial-branch` in Git?
Open an interactive chat with Bash
Why does the organization's policy prefer `main` over `master` as the branch name?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access