Bird
0
0

What will be the output of the command git status immediately after running git init in a new directory?

medium📝 Command Output Q13 of 15
Linux CLI - Package Management
What will be the output of the command git status immediately after running git init in a new directory?
Afatal: not a git repository (or any of the parent directories): .git
BOn branch main nothing to commit, working tree clean
COn branch main No commits yet nothing to commit (create/copy files and use "git add" to track)
DOn branch master nothing to commit, working tree clean
Step-by-Step Solution
Solution:
  1. Step 1: Understand initial state after git init

    After initializing, the repository has no commits yet, so git status shows "No commits yet" and instructions to add files.
  2. Step 2: Check branch name and messages

    Modern Git uses "main" as default branch, and the message includes "nothing to commit (create/copy files and use \"git add\" to track)".
  3. Final Answer:

    On branch main No commits yet nothing to commit (create/copy files and use "git add" to track) -> Option C
  4. Quick Check:

    New repo status shows no commits yet [OK]
Quick Trick: New repo shows 'No commits yet' on main branch [OK]
Common Mistakes:
  • Expecting 'master' branch instead of 'main'
  • Thinking working tree is clean immediately
  • Confusing error message with valid status

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes