desktop: Default Branch does not Update

Description

Upon updating the default branch in my private GitHub repo, Desktop does not update. The old branch is still marked as default and used by default for new branches.

Version

  • GitHub Desktop: 1.4.0
  • Operating system: macOS High Sierra V 10.13.6

Steps to Reproduce

  1. Have a private GitHub repo with a default branch dev
  2. Create another branch named develop
  3. Change the settings of the branch such that develop is the default.
  4. Go back to GitHub Desktop, restart, do whatever, and observe that the default branch remains dev

Expected Behavior

On the next fetch or at least upon restarting the app, the default branch would update accordingly to develop

Actual Behavior

The default branch remains the previous default branch.

Additional Information

screen shot 2018-09-21 at 3 40 05 pm screen shot 2018-09-21 at 3 40 15 pm

Logs

It happened one of these days based off history. I don’t see anything relating to default, but maybe they’ll be useful.

2018-09-13.desktop.production.log 2018-09-14.desktop.production.log

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 11
  • Comments: 26 (6 by maintainers)

Most upvoted comments

@Timawg Click the Current Repository dropdown in the top-left corner and select the already selected repo to reload it, which will re-sync the default branch. Screen Shot 2019-08-23 at 12 24 53 PM

if anyone still facing this problem:

  • try running this command in your repo folder: git symbolic-ref refs/remotes/origin/HEAD image
  • if you get the old default branch name, then go to <your repo folder>/.git/refs/remotes/origin/HEAD and change its value to your real default branch image
  • restart Github Desktop, that’s it! it should recognize the real default branch in creating, rebase, and everywhere else. image

@alburdette619 Thank you so much for reporting this and being so detailed in helping us to reproduce it! ❤️

I was able to reproduce this just now with a private repo and a public repo. Since we sort the default branch separately from the others and call it out specifically, I’m going to categorize this as a bug. But if I’m missing something, others feel free to weigh in.

@celloworld That did the trick, thank you!

Just updated one of my repos to switch the default branch. Desktop is still referencing the old default.

Looking at DevTools, when you fetch, it makes a call to https://api.github.com/repos/*/* and the new default branch is returned correctly, but it seems to be ignored.

I just removed the repo and re-cloned it and it fixed itself

Had the exact same issued.

Surprisingly all I had to do was to clone my repository on different path. After doing this, default branch was the intended (the one that is shown on github web), and also Branch->Update from “default branch”, option was working too.

Then removed the repo that had just created. On my old branch the default branch is the correct one and Branch->Update from “default branch” option was working there too .

I had the same issue. Fixed by deleting the GitHub Desktop folder from Application Support and the app from the Applications folders, re-downloading, and re-adding the local repositories on my M1 Mac.