CiscoDevNet / DNAC-AURA

MIT License
37 stars 14 forks source link

Use shallow clones by default #11

Closed mochipon closed 2 years ago

mochipon commented 2 years ago

This repository manages large binary files, so cloning everything is a waste of time. By using shallow clones, downloading can be done 3 times faster. 🚀

This difference will become more significant as more and more commits are made in the future.

Deep clone

$ time git clone https://github.com/CiscoDevNet/DNAC-AURA.git DNAC-AURA-deep-clone
Cloning into 'DNAC-AURA-deep-clone'...
remote: Enumerating objects: 567, done.
remote: Counting objects: 100% (565/565), done.
remote: Compressing objects: 100% (206/206), done.
Receiving objects: 100% (567/567), 65.36 MiB | 1.29 MiB/s, done.
remote: Total 567 (delta 356), reused 563 (delta 355), pack-reused 2
Resolving deltas: 100% (356/356), done.

real    0m54.169s
user    0m2.060s
sys 0m3.187s

$ du -h -d 0 DNAC-AURA-deep-clone
 93M    DNAC-AURA-deep-clone

Shallow clone

$ time git clone --depth=1 https://github.com/CiscoDevNet/DNAC-AURA.git DNAC-AURA-shallow-clone
Cloning into 'DNAC-AURA-shallow-clone'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 12 (delta 1), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (12/12), 8.79 MiB | 497.00 KiB/s, done.
Resolving deltas: 100% (1/1), done.

real    0m20.618s
user    0m0.351s
sys 0m0.508s

$ du -h -d 0 DNAC-AURA-shallow-clone
 22M    DNAC-AURA-shallow-clone

This PR also fixes some minor typos.