In the v2 API, how do I get and set default repository branches?
It is possible in v1 API, but that has now been deprecated. There are over 50 repositories, so it is not feasible to do manually.
Hello @Emilio Ziniades and welcome to the Community!
To update repository settings you would usually need to leverage the Update a repository API endpoint. However, I'm afraid that updating the main branch is currently not supported on that endpoint. We do have an open feature request to implement this functionality :
I would suggest adding your Vote on that feature request to give it traction, and also mark yourself as a Watcher to receive first-hand updates whenever there's any progress on its implementation.
While that feature is not available, you can change the main branch of a repository on the UI by navigating to Repository Settings > Repository Details > expand Advanced > Main branch.
Thank you, @Emilio Ziniades !
Patrik S
Hey @Patrik S , thanks for the feedback. I have voted for the above issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.