0
0
Gitdevops~10 mins

Shallow clones with depth in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to clone a repository with a depth of 1.

Git
git clone --depth [1] https://github.com/example/repo.git
Drag options to blanks, or click blank then click option'
A1
Blatest
Cshallow
Dfull
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-numeric values like 'full' or 'shallow' for depth.
Omitting the depth option and cloning the full history.
2fill in blank
medium

Complete the command to fetch the last 5 commits from a remote repository.

Git
git clone --depth [1] https://github.com/example/repo.git
Drag options to blanks, or click blank then click option'
A0
B10
C1
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 as depth, which is invalid.
Using a depth larger than needed.
3fill in blank
hard

Fix the error in the command to create a shallow clone with depth 3.

Git
git clone --depth [1] https://github.com/example/repo.git
Drag options to blanks, or click blank then click option'
A3
Bdepth 3
C3 --shallow
Dthree
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' after --depth which is not valid in git clone.
Writing the depth as a word instead of a number.
4fill in blank
hard

Fill both blanks to create a shallow clone with depth 2 and single branch.

Git
git clone --depth [1] --branch [2] https://github.com/example/repo.git
Drag options to blanks, or click blank then click option'
A2
Bmain
Cmaster
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using depth 1 when 2 is requested.
Using the wrong branch name.
5fill in blank
hard

Fill both blanks to fetch a shallow clone with depth 4, branch 'develop', and single branch option.

Git
git clone --depth [1] --branch [2] --single-branch https://github.com/example/repo.git
Drag options to blanks, or click blank then click option'
A4
Bdevelop
D--quiet
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a value after --single-branch which causes an error.
Using wrong branch name or depth.