312-97 practice question 15 of 35

(Jayson Smith is working as a DevSecOps engineer in an MNC company located in Tampa, Florid a. The senior software developer of his company, Sandra…

Full set: 100 questions
(Jayson Smith is working as a DevSecOps engineer in an MNC company located in Tampa, Florid a. The senior software developer of his company, Sandra Oliver, has uploaded an application in her GitHub repository that might contain security vulnerabilities and has provided the URL to the DevSecOps team. Jayson would like to analyze the application developed by Sandra to detect and mitigate the security issues in the application code; therefore, he would like to clone Sandra’s GitHub repository to his computer. Which of the following commands should Jayson use to clone the repository of another user to his computer?)
Answer options
A: $ git clone https://github.com/REPOSITORY/USERNAME.git.
B: $ git clone https://github.com/USERNAME/REPOSITORY.git. Correct answer
C: $ github clone https://github.com/USERNAME/REPOSITORY.git.
D: $ github clone https://github.com/ REPOSITORY/USERNAME.git.
Correct Answer:
B. $ git clone https://github.com/USERNAME/REPOSITORY.git.
Explanation

git clone expects the path format https://github.com//.git.
To copy another user’s project you substitute the owner’s GitHub user name first, followed by the repository name, e.g.,
git clone https://github.com/USERNAME/REPOSITORY.git.

Why Incorrect

A. Reverses repository and user position, producing 404 error.
C. Uses nonexistent “github” command rather than “git”.
D. Wrong command and reversed path segments.

References

1. GitHub Docs, “Cloning a repository”, https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository, Step 2 example.

2. Chacon & Straub, “Pro Git”, Apress, 2nd ed., Ch. 2.3, URL syntax figure.

Scroll to Top