Unable to change default branch #24324
-
This is an odd one - I don’t seem to be able to change the default branch from I found this topic from 2019, but this doesn’t seem to work even with the correct API calls. GH’s direct contact support is busy and I haven’t gotten a reply yet, so I was wondering if anyone else has run into this. Here’s what happens: Via the API (using the
Via the Web UI
I’m mostly wondering if this is unique to our org, or other people are running into this one. For added context:
|
Beta Was this translation helpful? Give feedback.
Replies: 14 comments
-
👋 hello there @gdude2002, and welcome to the GitHub Support Community! 🎉
gdude2002:
Thanks for sharing those steps here. I attempted to reproduce this as described, but I see that the update propagated. Below is a motion picture of this in action: I’m wondering if you’re still seeing this behavior?
gdude2002:
While I can’t speak to the
I’m wondering if you’re able to reproduce this on a public repository using these |
Beta Was this translation helpful? Give feedback.
-
Apologies for not responding for so long - I didn’t get an email for some reason. I am still noticing this behaviour. An example of a repository I’m seeing it on is this one from the Kotlin-Discord org. This is a public repository, and it’s the repository I tested on in my original post. |
Beta Was this translation helpful? Give feedback.
-
gdude2002:
Thanks for following up @gdude2002! No worries on the timing ✌️
Depending on your input, we’ll take the next steps from there 👍 |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick response! Of course, Murphy’s law - as soon as I try to record, it works. Genuinely unbelievable, haha. Do you know if anyone looked into this in the interim and changed anything? I guess it’s going to be difficult to provide extra info when I can no longer reproduce, but at least it works I guess. |
Beta Was this translation helpful? Give feedback.
-
gdude2002:
@gdude2002 - I’m so glad to hear that it works now! ✨ While I can’t speak to any one specific change, it’s definitely possible that one of our engineering teams deployed an update between your original post and now. 🚀 If you’re seeing any other instances of this in the future, please open a new topic with steps to reproduce the behavior and we’ll do our best to help. ✌️ |
Beta Was this translation helpful? Give feedback.
-
This problem is not fixed!!! I changed the default branch to master but now the default branch is random between the two every time I refresh the page. Same randomness happened on Code and Settings tabs! |
Beta Was this translation helpful? Give feedback.
-
Just so you’re aware, I worked with GH support via email and the problem turned out to be a Probot config issue — someone had actually configured Probot to reset the branch. So, if you’re using Probot or some other GH bot/application, it’s always good to check those! |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, not using Probot. For some reason default branch was develop, trying to change it to master and it just won’t happen. Note that I imported the repo from a different account, and the visibility was private in the old account and it is public in the current account. Also note that the default branch in the first account was master–I don’t know why it became develop, nor why changing it doesn’t work. |
Beta Was this translation helpful? Give feedback.
-
Hi there @ChessDigits 👋 That’s unfortunate to hear that you’re still unable to modify your default branch name! Presumably, you’re updating this via the API. You do also have the option to change via the UI: docs.github.comChanging the default branch - GitHub Docs//docs.github.com/en/github/administering-a-repository/changing-the-default-branch …but if you’re failing to update via API, perhaps you could provide the output of a If you do share this output, please be sure to obscure any sensitive data (like a PAT that might be used for API access) when you post. Cheers! |
Beta Was this translation helpful? Give feedback.
-
I don’t know what you mean with the API. I’m changing it directly from the GitHub website (repo > settings > branches). Now that being said it does look like it caught on, thought it does happen sometimes it’ll still show develop… Seriously there seems to be a bug with this feature. Anyway, no need to reply anymore, you do what you want with the feedback. |
Beta Was this translation helpful? Give feedback.
-
Hi @ChessDigits !
Edit: the primary focus of this thread is about behavior relating to the API, and outdated experiences from the UI that should no longer occur. Perhaps we should get a new thread started in the GitHub Help How to Use Git and GitHub board. Though I’m also happy to accept your feedback, but I’m not quite sure what’s failing so far. Would you mind sharing screenshots of the flow in the UI? If any errors are elevated, seeing those errors in the dev console from the browser would be interesting! As an aside, I went back over my personal repositories that were still named |
Beta Was this translation helpful? Give feedback.
-
necro bumping this for anyone who google's there way here like i did. the issue is the two
|
Beta Was this translation helpful? Give feedback.
-
As of now (20250227), the correct location is: Settings - General - Default branch (it's under the General category, not under Branches). |
Beta Was this translation helpful? Give feedback.
@gdude2002 - I’m so glad to hear that it works now! ✨ While I can’t speak to any one specific change, it’s definitely possible that one of our engineering teams deployed an update between your original post and now. 🚀
If you’re seeing any other instances of this in the future, please open a new topic with steps to reproduce the behavior and we’ll do our best to help. ✌️