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.

Github Desktop won't update Default Branch to main

See original GitHub issue

Describe the bug

In the repository and from the command and in every conceivable place I have updated my default to main. However, when I click on the dropdown from Github Desktop it still displays master as the Default branch.

NOTES:

  • I have gone through every previous related issue and followed steps to solve to no avail.
  • This command: git symbolic-ref refs/remotes/origin/HEAD | sed ‘s@^refs/remotes/origin/@@’ returns: main
  • master branch has been deleted

Version & OS

Github Desktop Version 2.9.6 (x64) macOS Monterey Version 12.0.1

Steps to reproduce the behavior

  1. Change default to main in the repository and delete master
  2. In every conceivable place change default branch to main
  3. Rub these steps: git branch -m master main git fetch origin git branch -u origin/main main git remote set-head origin -a git branch -d -r origin/master
  4. Confirm default is main using command line and checking repository and user settings
  5. Restart computer and/or git
  6. Notice that default in the dropdown still lists master

Expected behavior

Default should not point to a branch that doesn’t exist. It should match whatever the remote repository points to.

Actual behavior

It is not updating

Screenshots

The interface here won’t allow me to upload a screenshot.

Logs

Not sure if I can share these as this is work related

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
JakeSidSmithcommented, Apr 20, 2022

@steveward did you mean #14266 ? I’ve just clicked through to this same page more times than I’d care to admin. 😂

1reaction
stevewardcommented, Jan 14, 2022

Thanks for the report @john-lebens-highspot. I tested this out a bit and it does seem that GitHub Desktop isn’t updating the default branch correctly. We’ve had reports of this in https://github.com/desktop/desktop/issues/11299 as well. I’ll label this a bug for us to look into.

For reference a fresh clone of the repository should resolve things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitHub Desktop show the wrong default branch · Issue #11299
Go to the remote repo and verify that master is set as the default. · Open GitHub Desktop and switch to the local...
Read more >
Default Branch does not Update · Issue #5709 · desktop/desktop
Have a private GitHub repo with a default branch dev · Create another branch named develop · Change the settings of the branch...
Read more >
Default branch not changing · Issue #14844 · desktop ... - GitHub
Here we set develop as our default Branch, but github desktop isn't updating it in the application and still shows main as our...
Read more >
Changing the default branch - GitHub Docs
Under your repository name, click Settings. ... Under "Default branch", to the right of the default branch name, click . ... Use the...
Read more >
GitHub Desktop still defaults to creating a default branch titled ...
Once it is created, go to GitHub Desktop and File>Clone repository... ... Current branch is now set to master. You cannot rename master...
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