Featured image of post How to Get Only the Latest Commit of a Repository with Git clone

How to Get Only the Latest Commit of a Repository with Git clone

We explain how to get only the latest commit (shallow clone) without downloading the entire history of a Git repository. This is a convenient technique to save disk space and quickly clone a repository using the '--depth 1' option.

Get only the latest of a git repository

You can get only the latest of a repository with the following command. It is useful when you want to quickly fetch a repository to save disk space.

1
git clone --depth 1 <repository URL>
comments powered by Disqus