5 ms·
Correct me if I'm wrong but doesn't a git clone involve downloading the project's entire git history as well as $CURRENT_VERSION? That seems a little excessive.
by discreditable 11y ago
Correct me if I'm wrong but doesn't a git clone involve downloading the project's entire git history as well as $CURRENT_VERSION? That seems a little excessive.
- nilved 11y agoYou can use `--depth=1` to only download one revision, and `--branch` to specify an alternate branch or tag.
- XorNot 11y agoAs far as I know though you can't grab a specific revision this way (I'd love to be shown otherwise) - which is an issue when setting up dockerfiles since you want to bake the sha hash which works into the file.
- akshaykarthik 11y agogit clone --depth=1 will get you just $CURRENT_VERSION
- hueving 11y agoBy default, yes. But you can use the --depth option to limit it to a clone of the most recent state.
- deleted 11y ago[deleted]
- tjbiddle 11y agoWhile I disagree with the authors sentiment as a whole; this issue could be solved by using a shallow clone.
- abritinthebay 11y agoIronically git actually supports TAR for this exact thing: git archive exports tar files. You can do a low depth to minimize that if you want (--depth=1 or something like that if I remember correctly). You could just rm -rf the root .git directory after but that is a download bloat issue. That said this should work: git clone --depth=1 --branch=master git://myrepo && rm -rf myrepo/.git` but.. yeah. Not really great.
- dajohnson89 11y agoAnd what if you find a bug, and want to regress to a previous version? What is so cumbersome about downloading a project's history?
- deleted 11y ago[deleted]
- ubernostrum 11y agoWell, some projects have been around for a while. "All the history" can be a LOT of history.
- eru 11y agoActually, even for the Linux kernel, it's only a few hundred megabyte.
- ufo 11y agoThe article suggests that this is not a big deal anymore now that computers have more storage and networks have more bandwidth.
- lukeschlather 11y agoThere are still a lot of networks that don't have enough bandwidth to make git trivial. Most home networks, it's going to turn a 5-second download into 60 seconds or more. Some networks, it's going to turn a 1-minute download into a half an hour.
- MBlume 11y agoSure, but on the other hand, downloading a tarball for every minor release means you're redownloading a lot of code. Depending on how much churn there is, you may save bandwidth in the long run by keeping a clone and updating as you go.