diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index 9fe7ff2b275..83a94ffc7d2 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -2460,7 +2460,20 @@ export class CommandCenter { } const remoteTagPicks = async (): Promise => { - const remoteTags = await repository.getRemoteRefs(remoteName, { tags: true }); + const remoteTagsRaw = await repository.getRemoteRefs(remoteName, { tags: true }); + + // Deduplicate annotated and lightweight tags + const remoteTagNames = new Set(); + const remoteTags: Ref[] = []; + + for (const tag of remoteTagsRaw) { + const tagName = (tag.name ?? '').replace(/\^{}$/, ''); + if (!remoteTagNames.has(tagName)) { + remoteTags.push({ ...tag, name: tagName }); + remoteTagNames.add(tagName); + } + } + return remoteTags.length === 0 ? [{ label: l10n.t('$(info) Remote "{0}" has no tags.', remoteName) }] : remoteTags.map(ref => new TagItem(ref)); };