Size of git repo when fetched

I'm trying to build a cargo project in a flatpak (first time) and each time flatpak-builder is building, it fetches all crates. (expected when ran within a container)

But the fetch stage takes 20 or so minutes on my slow connection. It seems to take a long time getting git repos and is really fast on the crates.io index.
Updating git repository 'https://github.com/gtk-rs/gtk-rs' Updating git submodule 'https://github.com/gtk-rs/gir' Updating git submodule 'https://github.com/gtk-rs/gir-files'

Is fetch, cloning the entire git history, or just the current 'snapshot' of the files?
I don't know enough about the internals of cargo/rust or git, but it'll be great if cargo only download's the minimum git data to compile.

p.s. At the moment I need the latest gtk-rs and not the current crates.io version.

It is cloning the entire git repo. Shallow clones are discouraged by github as they increase load on their servers due to being unable to push pack files that are already created. Also by cloning the entire git repo future updates are much faster.

1 Like