Limiting tags when using git fetch
TL;DR
If you are using git tag --contains=<commit> but it becomes unworkable due to
a flood of CI-generated tags, you can fix it by setting tagOpt = --no-tags in
your configuration and by using negative refspecs, which limit the number of
tags you are fetching. Both are placed on the remote.
[remote "upstream"]
url = git@gitlab.com:owner/project.git
fetch = +refs/heads/*:refs/remotes/upstream/*
tagOpt = --no-tags
fetch = ^refs/tags/*-development
Tag explosions while needing to find commits in tags
At work, our CI creates tags for each build when our pipelines are completed.
The reason is that our deployment tooling requires an identifier, and they have
settled on using a tag. The problem for me with that is I have a repository
that contains over 1000 tags. Previously, I could use git tag --contains <commit-ish> to see which release a commit was found in. I still have the
ability to do so, but I needed to filter out all the automated nothingness of
CI-generated tags.
.... read more ....See all Article posts