Doesn't actually create branches? #460
Replies: 1 comment 1 reply
-
could you describe your use case a bit? setting the default branch name is supported, but i'm curious about your expectation to create the branch. settings accomplishes the current approach in the api call to update the settings of the repo: https://docs.github.com/en/rest/reference/repos#update-a-repository. the change supported here is simply switching the default from one existing branch to a different existing branch, like https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/changing-the-default-branch alternatively, it is possible to rename an existing branch to a different name without switching to a separate, already existing branch, like https://docs.github.com/en/github/administering-a-repository/managing-branches-in-your-repository/renaming-a-branch. additional guidance can be found in https://github.com/github/renaming. if you have lots of repos where you want to rename the default branch, you might consider using octoherd: https://github.com/octoherd/script-rename-master-branch-to-main however, i wouldnt expect a tool like settings to create a branch in either of these scenarios. could you expand on why you would expect a branch to be created and what part settings would play in such a scenario?
|
Beta Was this translation helpful? Give feedback.
-
I'm trying to set this up for (on site deployment for our GHE) a test org. And one of the things I wanted to be able to do was to use
main
as the default branch rather thanmaster
.So, I created a section in my YAML for the
main
branch and included some branch protection rules. But I get an error saying that the branchmain
was not found. Should that have been created?Also, I did not see a mechanism to specify what the default branch was?
Beta Was this translation helpful? Give feedback.
All reactions