XK0-006 practice question 1 of 15
A DevOps engineer needs to create a local Git repository. Which of the following commands should the engineer use?
Full set: 149 questionsThe git init command is used to create a new, empty Git repository in the current directory. It can also be used to convert an existing, unversioned project into a Git repository. This command creates a .git subdirectory in the project root, which contains all of the necessary metadata and object database for the new repository. This is the fundamental first step for creating a local version control system for a project from scratch.
B. git clone is used to obtain a copy of an existing remote repository, not to create a new local one from scratch.
C. git config sets user-specific or global configuration options for Git, but it does not create a repository.
D. git add stages changes for the next commit and operates within an already existing Git repository.
1. Official Git Documentation. git-init(1) Manual Page. Retrieved from git-scm.com. It states, "This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files."
2. Chacon, S., & Straub, B. (2014). Pro Git (2nd ed.). Apress. Chapter 2.1, "Getting a Git Repository," states: "You can get a Git repository in one of two ways... The first is to take a local directory that is currently not under version control, and turn it into a Git repository... by running the command git init."
3. Loeliger, J., & McCullough, M. (2012). Version Control with Git (2nd ed.). O'Reilly Media. Chapter 3, "Getting Started with Git," details the use of git init as the primary method for creating a new repository.
Keep practicing
Take the free XK0-006 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other XK0-006 practice questions
- Question 2Which of the following is the main reason for setting up password expiry policies?
- Question 3A Linux administrator needs to securely erase the contents of a hard disk. Which of the f…
- Question 4Which of the following best describes the role of initrd?
- Question 5Which of the following is a characteristic of Python 3?
- Question 6A Linux user runs the following command: nohup ping comptia.com & Which of the following …
- Question 7A systems administrator needs to enable routing of IP packets between network interfaces.…
