I am trying to create a --shallow-since working clone from a local bare clone but it keeps pulling everything. --depth=N works fine.
I'm thinking the issue is I'm using the wrong format? I've tried searching but no where does it explicitly say what format < date > is supposed to be for --shallow-since=< date >.
Shallow clones are the fastest way to get a copy of the working directory at the tip commit. If you need the commit history for your build, then a treeless partial clone might work better for you than a full clone.
A shallow repository has an incomplete history some of whose commits have parents cauterized away (in other words, Git is told to pretend that these commits do not have the parents, even though they are recorded in the commit object).
The first solution to a fast clone and saving developer's and system's time and disk space is to copy only recent revisions. Git's shallow clone option allows you to pull down only the latest n commits of the repo's history. Imagine you accumulated ten or more years of project history in your repository.
I used:
--shallow-since="3 years"
and it worked fine.
Using UNIX timestamp:
git fetch upstream master --shallow-since=1589324214
on git version 2.26.2.windows.1
and in GitHub actions CI also works just fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With