Take stash for example. If any branch has a stash, the branch named stash appears as heads/stash in the branch list.
GitHub Desktop can only switch to the stash branch when it reads stash, but will land on a detached HEAD after switching to “heads/stash”.
I also found names such as upstream or existing tag names (e.g., both a v0.1 branch and a v0.1 tag) affecting.
That means using main as a tag name is playing with fire.
This problem does not affect the git commmand line – git checkout stash can return the repo (including the GitHub Desktop UI) to the real stash branch.
Release version
3.3.14-beta2, 3.3.13-beta1 (also occured before, but didn’t investigate)
Operating system
Windows 11 (x64)
Steps to reproduce the behavior for stash
Create/open an empty repository
Rename the default branch to stash
✅ The branch list reads “Recent branches: stash”
Stash something (e.g, a deletion of the auto-created .gitattributes)
❎ The branch list reads “Other branches: heads/stash”
Log files
I read the recent entries and found nothing related to this matter.
Screenshots
Additional context
When both a stash and the stash branch exists,
$ git checkout stash
warning: refname 'stash' is ambiguous.
Switched to branch 'stash'
The problem
title says it mostly
Take
stash
for example. If any branch has a stash, the branch namedstash
appears asheads/stash
in the branch list. GitHub Desktop can only switch to thestash
branch when it readsstash
, but will land on a detached HEAD after switching to “heads/stash
”.I also found names such as
upstream
or existing tag names (e.g., both av0.1
branch and av0.1
tag) affecting. That means usingmain
as a tag name is playing with fire.This problem does not affect the
git
commmand line –git checkout stash
can return the repo (including the GitHub Desktop UI) to the realstash
branch.Release version
3.3.14-beta2
,3.3.13-beta1
(also occured before, but didn’t investigate)Operating system
Windows 11 (x64)
Steps to reproduce the behavior for
stash
stash
stash
”.gitattributes
)heads/stash
”Log files
I read the recent entries and found nothing related to this matter.
Screenshots
Additional context
stash
branch exists,This is not an April Fool’s ticket.
Originally posted by @ParadoxV5 in https://github.com/desktop/desktop/issues/18395