Large size of repo while fetching with script

I just installed homebrew on my mac using the installer script. It fetched about 300MB of git content.
Is there a possibility that we can do a shallow clone of homebrew? And if so, can the installer script be modified so that it does a shallow clone by default? That would reduce the size by quite a bit I believe

That can’t be done without sacrificing some homebrew functionality. Things like brew extract need a full clone. In terms of network traffic, this website is already 6MB, I don’t think 300MB is anything to worry about these days.

Shallow clones suffer a big performance penalty on all updates, so we won’t be adding this feature by default. You can of course install Homebrew with many different methods, including just unpacking the tarball somewhere, as detailed in our documentation: https://docs.brew.sh/Installation