Skip to content

De-hardcode the default branch of a remote repo #821

@yashi

Description

@yashi

Should we keep using master as the default? Or, we could determine the default branch of a remote repo using:

git ls-remote --symref $REPO_RUL HEAD

Such as

GitHub

❯ git ls-remote --symref https://github.com/zephyrproject-rtos/zephyr HEAD
ref: refs/heads/main	HEAD
4bd1d39c67dfb4860fbd4f9ccc17e084aa32d763	HEAD

GitLab

❯ git ls-remote --symref https://gitlab.gnome.org/GNOME/glib.git HEAD
ref: refs/heads/main	HEAD
804553b12606a728e9d6fab7b12d1d8f4277f03e	HEAD

cc:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions