I have read a while ago that it is possible to clone a repository in a more performative way just by downloading the last commit, that is, downloading the repository without previous changes to other commits.
How can I do this?
I have read a while ago that it is possible to clone a repository in a more performative way just by downloading the last commit, that is, downloading the repository without previous changes to other commits.
How can I do this?
Use the switch --depth
:
Example:
git clone --depth=1 <url_do_meu_repositório>
However, this practice of shallow copy (SVN style) is not usually the best solution in the Git world for a number of reasons:
filter-branch
and purge
to decrease the size of very large repositories. Alternatively, if you really need it, you can clone a single branch:
git clone -b meugalho --single-branch <url_do_meu_repositório>