Problem to solve
We need to have a bash script that changes the default branch of a repository. I connot find a git CLI command or API operation which could do that
- I could not find an operation that would do the job. Manually using the UI seems to be the only option.
- I would expect a API or CLI command to do that job
Steps to reproduce
- Using gitlab UI create a repository, define a branch (master), define it as the default branch.
- Using gitlab UI create a second branch (newmaster)
- use (unix) shell command to change the default branch to “newmaster” (how???)
-OR- - use curl API command to change the default branch to “newmaster” (how???)
Versions
Please select whether options apply, and add the version information.
- Self-managed
- GitLab.com SaaS
Versions
- GitLab Community Edition [v17.0.2]
(Maintenance Rake tasks | GitLab)):