Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 712 Bytes

File metadata and controls

25 lines (16 loc) · 712 Bytes

Shallow Clone Limited to Latest Commit

Company: Elastic | Difficulty: Easy


Scenario

A deployment pipeline is experiencing slow build times because it performs full history clones.

Task

Navigate to /home/interview/workspace and create a shallow clone of the repository (file:///tmp/source-repo/repo.git) named shallow-repo, restricted to the latest commit only.

Example

# Verify the clone is shallow (Has only 1 commit)
$ cd shallow-repo
$ git log --oneline
a1b2c3d (HEAD -> main, origin/main, origin/HEAD) Update deployment config

📹 Video Solution