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...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .