Ran into the same thing today, found the git repository cached on my master at /var/lib/jenkins/caches
if you have lots of git repos you will need to try and find your specific one since they are listed by hashes and not by name.
[jenkins@jenkinsmaster caches]$ pwd
/var/lib/jenkins/caches
[jenkins@jenkinsmaster caches]$ ls -als
...
4 drwxr-xr-x. 3 jenkins jenkins 4096 Nov 8 09:10 git-bbcfdeb24494d83c13621c40b3b14ffd
4 drwxr-xr-x. 2 jenkins jenkins 4096 Nov 8 09:10 git-bbcfdeb24494d83c13621c40b3b14ffd@tmp
...
Once I found the correct one ( by going into each and running a git tag -l
looking for my unwanted tags. I just deleted the git-<hash>
and git-<hash>@tmp
folders from that directory. Re-ran my Job and the source was fully checked out again and did not have the unwanted tags. :^)
Note that, as commented below, in the Jenkins script console you can run:
println('git-'+hudson.Util.getDigestOf('remote'))
where remote
is the the URL of the git remote, to identify the correct cache.