Bird
0
0

What is the purpose of the git init command in repository management?

easy📝 Conceptual Q11 of 15
Linux CLI - Package Management
What is the purpose of the git init command in repository management?
ATo add files to the staging area
BTo check the status of the repository
CTo upload changes to a remote repository
DTo create a new Git repository in the current directory
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of git init

    This command sets up a new Git repository by creating necessary files and folders in the current directory.
  2. Step 2: Differentiate from other commands

    git add stages files, git push uploads changes, and git status shows repository state, so they do not create a repository.
  3. Final Answer:

    To create a new Git repository in the current directory -> Option D
  4. Quick Check:

    git init creates repo [OK]
Quick Trick: Remember: init means start a new repo [OK]
Common Mistakes:
  • Confusing git init with git add
  • Thinking git init uploads files
  • Using git init to check status

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes