[JENKINS-56517] fetch has 3 options: nothing, --no-tags, --tags, jenkins only 2
git fetch has three options to fetch tags:
- "git fetch" fetches a branch with tags reachable, the ideal default
- "git fetch --no-tags" fetches a branch without tags
- "git fetch --tags" fetches tags not reachable from the branch, i.e. other branches also
in jenkins variant 1, fetching tags reachable cannot be configured any more (with ease), while it reasonably should be the default? also the branch name is not there in the git repo fetched. all of these operatins add labels to existing commits so do not increase the clone size.
this should be for multibranch pipeline, not sure what the correct component is.
the current workaround is:
// code placeholder
Originally reported by rthurner, imported from: fetch has 3 options: nothing, --no-tags, --tags, jenkins only 2
- status: Open
- priority: Major
- component(s): git-plugin
- resolution: Unresolved
- votes: 1
- watchers: 4
- imported: 2025-12-02
Raw content of original issue
git fetch has three options to fetch tags:
- "git fetch" fetches a branch with tags reachable, the ideal default
- "git fetch --no-tags" fetches a branch without tags
- "git fetch --tags" fetches tags not reachable from the branch, i.e. other branches also
in jenkins variant 1, fetching tags reachable cannot be configured any more (with ease), while it reasonably should be the default? also the branch name is not there in the git repo fetched. all of these operatins add labels to existing commits so do not increase the clone size.
this should be for multibranch pipeline, not sure what the correct component is.
the current workaround is:
// code placeholder
rthurner:
- Original comment link
Raw content of original comment:
remove blocker - does not help somebody looking at it ...
remove blocker - does not help somebody looking at it ...
rthurner:
- Original comment link
Raw content of original comment:
duplicate of
JENKINS-45164
duplicate of JENKINS-45164
sgka:
- Original comment link
Raw content of original comment:
Came across this issue as well. For an old repo with a lot of tags, I don't want to pull all of them. But I still want some of the tags, essentially any tags that are tied to commits in the shallow clone depth. The first option is most desirable in this case.
A poor workaround is to specify a refspec to pull some of the tags, like +refs/tags/2023*:refs/remotes/%{remote}/2023*. Due to the limitations of refspec, there doesn't seem to be a better way to fetch recent tags, and this would stop working after 2024 obviously.
Came across this issue as well. For an old repo with a lot of tags, I don't want to pull all of them. But I still want some of the tags, essentially any tags that are tied to commits in the shallow clone depth. The first option is most desirable in this case.
A poor workaround is to specify a refspec to pull some of the tags, like +refs/tags/2023*:refs/remotes/%{remote}/2023*. Due to the limitations of refspec, there doesn't seem to be a better way to fetch recent tags, and this would stop working after 2024 obviously.