Feature request: Option to shallow clone but still fetch tags
See original GitHub issueWe use the Python package setuptools-git-version for a variety of Python package automation steps and it runs git describe --tags --long --dirty
in order to compare the HEAD commit with the most recent tag.
With checkout@v2’s default to shallow clones (a default that I agree is sensible), this no longer works, and we have to set fetch-depth: 0
. This works just fine, but it would be nice if there were an option to do a shallow clone of the HEAD commit and also fetch tags.
Thanks for considering.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:29
- Comments:7
Top Results From Across the Web
Get up to speed with partial clone and shallow clone
Git's partial clone and shallow clone features are options that can help here, but they come with their own tradeoffs. Each option breaks...
Read more >Need to omit `--tags` when performing shallow clone.
I am trying to speed up the checkout step when building a large repository. I have enabled shallow clones by setting fetch depth....
Read more >Project Setting "Git shallow clone" and "GIT_DEPTH ... - GitLab
Per the documentation, a "Git shallow clone" value >0 and <=1000 should perform a shallow clone and fetch refs up to the value...
Read more >How to Use Git Shallow Clone to Improve Performance
Your teams can still clone, push, and pull code using Git. They won't even know the difference! But unlike with native Git, developers...
Read more >Can I make Git fetch a repository tag list without actually ...
If fetching to a shallow repository created by git clone with --depth= option (see git- clone(1)), deepen or shorten the history to the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m looking for this feature as well (the ability to
git-describe
the checkout), but I don’t think this can be done in a shallow manner. That said, you don’t need unrelated history; only the history related to the desired commit. Right now I’m usingfetch-depth: 0
as a workaround, but that is a heavy hammer that is pulling in more than necessary.The default checkout seems to do:
and I think by omitting
--no-tags
and--depth=1
, it achieves the desired goals. (Note, that specifying--tags
is not the same as omitting--no-tags
.) Ie:It would be nice if there was an easy way to configure this type of checkout.
Setting
fetch-depth: 0
seems as simple as it gets.