Skip to content

Reopened issues/18456 about local tags staying stale in desktop app after git fetch origin --prune #22953

Open

Description

@absol89

The problem

Confirmed this issue with an annotated tag that was moved/recreated on a different commit.

In my repository, GitHub Desktop continued displaying v2.3.3 on the old commit:

490917e5735d8cbbba60e63decfad6a23aa582d6

The remote v2.3.3 tag had subsequently been updated to:

b0efc1a78ef8b41c57ffa5a1e477f1ad5208d387

I confirmed the local Git ref was stale:

git rev-parse v2.3.3
b10685ddbd83406fc11ada5c2926e27c9a45f094

git fetch origin --prune did not update the existing local tag.

The remote tag resolved to:

e2a74e596e70967f62db3d465c477b5b7cc21b5b refs/tags/v2.3.3
b0efc1a78ef8b41c57ffa5a1e477f1ad5208d387 refs/tags/v2.3.3^{}

I then forced a fetch of the specific tag:

git fetch origin "refs/tags/v2.3.3:refs/tags/v2.3.3" --force

Git reported:

[tag update] v2.3.3 -> v2.3.3

After that, git show v2.3.3 resolved to b0efc1a78ef8b41c57ffa5a1e477f1ad5208d387, and after restarting GitHub Desktop, the UI displayed the tag on the correct commit.

So the issue appears reproducible when a tag is moved/recreated: a normal git fetch --prune leaves the existing local tag stale, and GitHub Desktop continues displaying that stale association. A forced update of the tag ref fixes it.

Release version

Version 3.6.6 (x64

Operating system

Windows x64

Steps to reproduce the behavior

Have 2 computers with github desktop
make computer 1 create a tag on branch and push
make computer 2 fetch and pull, then move the tag
make computer 2 push the new tag location to origin
make computer 1 git fetch origin --prune , check UI

Log files

2026-10-01.desktop.production.log
2026-09-30.desktop.production.log

Screenshots

Image

In this screenshot, the computer 1 had the local tag cached on the commit from 1 hour ago.
In this screenshot, the computer 2 and main on remote origin had the tag on the most recent commit (correct)

Additional context

No response

Activity

  1. desktop-triage commented on Oct 1, 2026

    @desktop-triage

    Triage summary: This is a duplicate of #18456 ("Deleted tag and recreated on different commit is not reflected in client"), which reports the identical root cause (git fetch does not force-update local tag refs that have moved) and was closed in 2024 as expected git behavior requiring a manual --force fetch. The reporter's own repro here reaches the same conclusion — a normal git fetch --prune leaves the stale local tag, and only git fetch origin "refs/tags/<tag>:refs/tags/<tag>" --force updates it.

    Initial hypothesis: GitHub Desktop's fetch implementation builds its fetch args in getFetchArgs in app/src/lib/git/fetch.ts lines 9–21, which invokes git fetch --progress --prune --recurse-submodules=on-demand -- <remote> without --force or an explicit tag refspec. Per standard git semantics, a plain fetch will not overwrite a local tag ref if it has diverged from the remote tag's new target (this is git's built-in protection against silently rewriting tag history), so a moved/recreated tag stays stale locally until a forced tag fetch is run — exactly as confirmed by the reporter's manual git fetch origin "refs/tags/v2.3.3:refs/tags/v2.3.3" --force workaround. This matches the explanation previously given by a maintainer in #18456, so no code change has been identified as needed beyond what was already discussed there (e.g., potentially force-fetching tags, which carries its own risk of silently discarding a differently-pointing local tag).

    Generated by Issue Triage (skills-driven) for #22953 · auto · 30.4 AIC · ⌖ 1.24 AIC · ⊞ 8.9K · ◷

  2. added
    bug
    priority-3
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions