git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to checkout a branch (and not a tag)

From
JWJeffrey Walton <noloader@gmail.com>
Date
Apr 11, 2021, 23:04 UTC
Message-ID
<CAH8yC8nT-68H9Vy=zxqsKeqpBqt-OJYCpVh53cm1KoeSbSVC-Q@mail.gmail.com>

I'm trying to checkout a branch called REL1_35 from https://github.com/wikimedia/mediawiki-skins-Cosmos. The repo also has a tag called REL1_35.

When I perform the following I apparently get the tag (with old files) and not the branch (with updated files):

    wiki_rel=REL1_53
    ...
    git fetch origin && git reset --hard "origin/${wiki_rel}" && \
        git checkout -f "${wiki_rel}" && git pull && git clean -xdf

I found https://groups.google.com/g/git-users/c/FfzGmqj6sNQ, but I am not following it. My .git/config looks like it is using the proper reference:

# cat skins/Cosmos/.git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = https://github.com/Universal-Omega/MediaWiki-Cosmos-skin.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "REL1_35"]
        remote = origin
        merge = refs/heads/REL1_35
How do I checkout the branch (and not a tag)?
Thanks in advance.
Next: Junio C Hamano
Message 1 of 3 in “How to checkout a branch (and not a tag)”
  1. Jeffrey WaltonApr 11, 2021
  2. Junio C HamanoApr 11, 2021
  3. Jeffrey WaltonApr 11, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.