GITHUB-FOUNDATIONS practice question 5 of 15

Which of the following best describes cloning a repository?

Full set: 75 questions
Answer options
A: It creates a copy of the repository on GitHub.com.
B: It retrieves code updates from the remote repository.
C: It creates a copy of the repository on your local machine. Correct answer
D: It imports your source code into a new repository.
Correct Answer:
C. It creates a copy of the repository on your local machine.
Explanation

The git clone command makes a full local copy of all files, history, branches, and tags that exist in the remote repository. This enables you to work offline, create new commits locally, and later synchronize changes back to the remote.

Why Incorrect

A. Forking or creating a new repo on GitHub produces an online copy; cloning copies to the local computer, not GitHub.com.
B. git pull or git fetch retrieves updates; cloning happens only once to obtain an initial local copy.
D. “Importing” initializes a new remote repository with existing code; cloning does not create a new remote, it copies an existing one locally.

References

1. GitHub Docs – “Cloning a repository,” paragraph 1: “When you clone a repository, you copy the repository from GitHub.com to your local computer.” (docs.github.com/en, 2023)

2. Chacon, S. & Straub, B. “Pro Git,” 2nd ed., Ch. 2.3 “Cloning a Repository,” para 1: “git clone … copy all of the repository’s data onto your local machine.” (Apress, 2014, DOI:10.1007/978-1-4842-0076-62)

3. Stanford Univ. CS198 Git Handout, p. 2: “Clone: make a complete local copy of an existing remote repository so you can work offline and push later.” (Stanford CS198, 2022)

Scroll to Top