Can't switch to version tag locally #12901
|
I see that each release has own tag at github releases. I has cloned lib locally and wanted to switch to tag, but I can't. Why? I suspect that RHF maintainer only creates tags at github, but does not hang them to merge commits. @bluebill1049, could you please fix it? It will be convenient to switch between diff versions via tags locally |
Replies: 1 comment
|
The release tags do point to commits. For example, I verified that There are two different cases worth checking:
A tag does not need to point to a merge commit; it can identify any commit. This release uses an annotated tag, which resolves through a tag object to its commit. If it still fails, the exact command/error plus AI-assisted verification: the fetch and detached checkout above were tested in a separate shallow clone with automatic tag fetching disabled. References: git fetch, git switch --detach. |
The release tags do point to commits. For example, I verified that
v7.60.0can be fetched and checked out, and resolves to commit2385f1766e54153455f065f0000298ad10201cfd.There are two different cases worth checking:
The tag is missing locally. Fetch the specific tag from the upstream remote:
Replace the tag with the version you want, and
originwith your upstream remote's name if it differs. For a shallow clone where you only want that snapshot,git fetch --depth=1 origin tag v7.60.0also works.git switch v7.60.0refuses because the name is a tag rather than a branch. Use detached mode to inspect a release: