I would like to change the default branch of the wiki but I can’t. The official documentation says that the wiki default branch is the same as the project. I do not find this to be the case. My project default is
master, while the wiki default is
main. I would like to chang the wiki default but nothing so far works.
I would also like to allow forced pushes to the default branch. I suppose this is not possible because the default branch is protected by default - but I have no idea how/where to change this behaviour.
Any tips/help/suggestions would be awesome. Thanks!
I’m assuming you are using Gitlab 14.1 or higher, so, if your project was created before this version, then yes, it will be master, since the default changed to main later. As the docs say:
So go to Admin → Settings → Repository and then expand Default Branch. You can also do this at group level, select the group and then in the group set the default branch.
What does it say in the initial branch name? After we upgraded, I changed this value to master. Therefore, I would assume based on the docs above, that if you didn’t change this value, then your wiki will default to main. If you change this and set it to master, then when you create a wiki it will use the master branch. Also any new projects created will also use master instead of main.
As for protected branches, select the project, then go to Settings → Repository and expand the protected branch section. Then you can disable protected branches for the ones that are configured.