3 ms·
The new depth option [1] on git clone as of 1.9.x should make the .git dir much more reasonable. > --depth <depth>: Create a shallow clone with a history trunc
by infogulch 13y ago
The new depth option [1] on git clone as of 1.9.x should make the .git dir much more reasonable.
> --depth <depth>: Create a shallow clone with a history truncated to the specified number of revisions.
If the OS and applications that are creating and modifying files are all honest about the file dates, it should be possible to only scan dates instead of reading out every file. Or even use ionotify-like events to track what changed.
[1]: http://git-scm.com/docs/git-clone http://git-scm.com/docs/git-clone
EDIT: As sisk points out below --depth itself is not new, but as of 1.9 the limitations that previously came with shallow clones were lifted. Thanks sisk.
- rwmj 13y agoI've wanted this option for so long :-) Are there any downsides to it, apart from the obvious one of 'git log' not going all the way back in time? I mean, do any commands break unexpectedly?
- sisk 13y agoThe --depth flag has been around for a long time but, previously, came with a number of limitations (cannot push from, pull from, or clone from a shallow clone). As of 1.9.0, those limitations have been removed. https://github.com/git/git/commit/82fba2b9d39163a0c9b7a3a2f35964cbc039e1a https://github.com/git/git/commit/82fba2b9d39163a0c9b7a3a2f3...