CS FundamentalsHardProduct-company DevOps interview

A CI job runs git clone --depth 1 on a large repository. Which statement is correct?

  1. A. It downloads only the latest commit's snapshot, saving time, but commands needing history (such as git describe, git log of old commits or some merges) will not work without fetching more
  2. B. It clones only the first file
  3. C. It clones all history but compresses it more
  4. D. It cannot be used for building

Correct answer: A. It downloads only the latest commit's snapshot, saving time, but commands needing history (such as git describe, git log of old commits or some merges) will not work without fetching more

A shallow clone truncates history to the given depth. It is ideal for building one commit, but tools that compute versions from tags or diff against older commits need --unshallow or a larger depth.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic