git clone --depth N ...
creates a shallow clone with history limited to the last N revisions and I can use git clone -b tag ...
to fetch the commits reachable from tag
. However, is there a way to fetch a repository (or a branch thereof) from a specific (tagged) commit up to the branch head?
Say, for example, I'd like to clone only the history starting from a specific release tag. So if the last few commits in the remote look like this
[master] ...
[master~1] ...
[master~2] ... <-- tag: x.x
[master~3] ...
...
Now I'd like to clone the history range x.x~1..
, without having to manually count the number of revisions to give to --depth
.
I guess the explanation given in the accepted answer to Why Isn't There A Git Clone Specific Commit Option? applies here as well, so there might not be a direct way.