siderolabs / kres

Tool to automate build instructions generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support different "trunk" branches

AlekSi opened this issue · comments

Currently, Kres assumes that the "main" branch is called "master". That does not work for other branch names like "main" which is the default branch name on GitHub for new repositories.

we need some good way to detect default branch name (without GitHub preferably).

Well, we need to know the default branch name to set up protected branches on GitHub, so why would it be better to detect without GitHub?

But if we have to: git remote show origin might be the answer. See https://stackoverflow.com/questions/28666357/git-how-to-get-default-branch

if only everybody had origin as their upstream, but should work probably anyways