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.

Wrong Default Branch Selected Locally

See original GitHub issue

Description

using only GitHub Desktop i created a branch named sfdx-master from master one. there i re-structured APEX files to comply with file structure requirements of SFDX way of packaging. that was experimental branch so i switched back to master then and tried to create another branch (i.e. feature-x), but GitHub Desktop showed me branch i had to create the new one from as sfdx-master, not master.

i thought it was a glitch, but i can reproduce that on that local copy again and again.

to solve the weird default branch issue i got to our GitLab repo, but the default branch there is still master despite i pushed to there and fetched updates from there.

in GitHub Desktop itself i do not see a setting to choose a default branch. afaik, gif also does not have the “default branch” concept. so i have no idea on how to set master as the default branch back.

Version

  • GitHub Desktop: 1.5.1
  • Operating system: Microsoft Windows [Version 10.0.17134.472]

Steps to Reproduce

  1. switch to master
  2. menu Branch > New Branch
  3. look at “Create branch based on…” selector

Expected Behavior

default branch is master

Actual Behavior

default branch is sfdx-master

Additional Information

image

Logs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shiftkeycommented, Jan 14, 2019

@hlopetz it might have been that the clone existed before the rename was applied, and in typical Git fetch/push/pull usage the rename of the default branch wasn’t updated?

Anyway, I’m glad we got to the bottom of the issue. I’m going to close this out as resolved, but let us know if you have any other questions about this.

1reaction
hlopetzcommented, Jan 14, 2019

thank you @shiftkey, git remote set-head origin master worked for me. the only Q is how that could happen if i used GitHub Desktop app only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 steps to change GitHub default branch from master to main
Follow these easy 5 steps to change the default branch name in your repo to 'main' instead of 'master' to show support for...
Read more >
How to change git default branch from master
Prerequisites · There are three steps in renaming the default branch · Change the branch name · Set remote upstream tracking for the...
Read more >
Change Default branch in gitlab - Stack Overflow
Under 'Settings' you will get section 'Default Branch' dropdown which will give you all branches for the repository. Select the desired branch.
Read more >
Change the default branch - Azure Repos | Microsoft Learn
Set a new default branch · Under your project repo, select Branches. · On the Branches page, select More options next to the...
Read more >
Default branch - GitLab Docs
Sign in to GitLab with at least the Maintainer role and follow the instructions to change the default branch for this project. Select...
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