On Sun, Apr 11, 2021 at 7:22 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > Jeffrey Walton <noloader@xxxxxxxxx> writes: > > > 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 > > Hopefully this typo is not part of what contributed to your problem. > Assuming that you actually used REL1_35 here... Yes, typo. > > ... > > git fetch origin && git reset --hard "origin/${wiki_rel}" && \ > > ...this should get their branches in refs/remotes/origin/, and would > reset whatever local branch you are on to origin/REL1_35. So at this > point, HEAD is the same as their REL1_35 branch. > > > git checkout -f "${wiki_rel}" > > And this causes the tag/REL1_35, which was obtained from them, to be > checked out to a detached HEAD. > > What are you trying to do here? Do you want your own local REL1_35 > branch, that starts at the same commit as their REL1_35 branch? I want an exact copy of the remote branch. After I get that copy, I usually delete unneeded fodder, like test gear and documentation. Jeff