LFCA · Question #15
Which of the following Git commands creates a new, empty Git repository?
The correct answer is D. git in it. The git init command initializes a new, empty Git repository in the current directory.
Question
Which of the following Git commands creates a new, empty Git repository?
Options
- Agit clone
- Bgit fork
- Cgit pull
- Dgit in it
How the community answered
(27 responses)- A4% (1)
- B4% (1)
- D93% (25)
Why each option
The `git init` command initializes a new, empty Git repository in the current directory.
`git clone` copies an existing remote repository into a new local directory.
`git fork` is a GitHub/GitLab specific operation to create a server-side copy of a repository, not a standard Git command-line operation for creating a new local repo.
`git pull` fetches changes from a remote repository and integrates them into the current branch.
The `git init` command creates a new, empty Git repository in the current directory, setting up the necessary `.git` subdirectory and initial files for version control.
Concept tested: Git repository initialization
Source: https://git-scm.com/docs/git-init
Topics
Community Discussion
No community discussion yet for this question.