question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default branch is stuck on a detached HEAD

See original GitHub issue

Describe the bug

My GH Desktop client (on MacOS) has gotten into a weird state where the default branch is a detached HEAD. The default branch has been set to heads/main when it should be main, and when I select heads/main it says I’m on a detached HEAD. When running git status the output is HEAD detached at refs/heads/main. Using git through the CLI I can checkout the main branch, but in GH Desktop I cannot see the main branch under my list of branches unless I specifically check it out in the command line.

I’ve tried uninstalling and reinstalling the client, signing in and signing out, deleting the repo from the client then re-adding it, and setting the global git config default branch. Nothing has worked so far.

Version & OS

Version 2.9.4 (x64) on MacOS

Steps to reproduce the behavior

I do not know what happened to get into this state.

Expected behavior

The default branch of the repository should be set to main, as it is in the GitHub repo settings

Actual behavior

The default branch of the repository is set to heads/main which is a non-existent branch. Clicking on this “default” says I’m on a detached HEAD. Trying to branch off of this default tells me I’m currently checking out a detached HEAD

Screenshots

Screen Shot 2021-10-26 at 2 18 51 PM Screen Shot 2021-10-26 at 2 19 32 PM

Logs

2021-10-13.desktop.production.log 2021-10-14.desktop.production.log 2021-10-15.desktop.production.log 2021-10-16.desktop.production.log 2021-10-17.desktop.production.log 2021-10-18.desktop.production.log 2021-10-19.desktop.production.log 2021-10-20.desktop.production.log 2021-10-21.desktop.production.log 2021-10-22.desktop.production.log 2021-10-23.desktop.production.log 2021-10-24.desktop.production.log 2021-10-25.desktop.production.log 2021-10-26.desktop.production.log

Additional context

No additional context.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
noelleredcommented, Mar 29, 2022

Nope this was resolved

On Tue, Mar 29, 2022, 8:23 AM Steve Ward @.***> wrote:

@noellered https://github.com/noellered following up here – is this still an issue you are experiencing in GitHub Desktop?

— Reply to this email directly, view it on GitHub https://github.com/desktop/desktop/issues/13193#issuecomment-1082011328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIDQE6FKQDU25MDNJDAXANTVCMN6XANCNFSM5GYZJT3A . You are receiving this because you were mentioned.Message ID: @.***>

0reactions
stevewardcommented, Mar 30, 2022

Glad to hear things are working again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix a Git detached head? - Stack Overflow
Detached head means you are no longer on a branch, you have checked out a single commit in the history (in this case...
Read more >
Git Detached Head: What Is It & How to Recover
Git detached head might be a weird error message, but don't despair. Learn what this means and how to fix it!
Read more >
Recovering from the Git detached HEAD state - CircleCI
Not at all. It just means you are not currently attached to any branch, and as a result, your HEAD is detached. If...
Read more >
What's a "detached HEAD" in Git? | Learn Version Control with ...
When in a detached HEAD state, it's terribly easy to lose valuable data. ... Normally, you use a branch name to communicate with...
Read more >
How To Fix A Detached Head On A Git Repository
Create a branch called “temp” by typing: git branch temp · Switch over to your new branch by checking it out: git checkout...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found