A shallow clone is a repository created by limiting the depth of the history that is cloned from an original repository. The depth of the cloned repository, which is selected when the cloning operation is performed, is defined as the number of total commits that the linear history of the repository will contain.
What is shallow clone depth?
"Clone depth" is a feature of git to reduce server load: Instead of cloning the complete repository (as usually done with git), using clone depth just clones the last clone-depth-number revisions of your repository. In literature this is also called "shallow clone"
How do I shallow clone git?
Shallow git clone steps
- Obtain the http url of the repository to clone.
- Include the –depth 5 option in the git clone command.
- Run the git clone command in the BASH shell.
- Switch into the directory created by the shallow git clone.
- Perform a git log –oneline operation to verify the clone depth.