How do you find the default branch of a remote git repository?

Viewed 774

Different repositories name their primary development branches differently (e.g. main, gh-pages, master, etc.), and scripts meant to work with multiple repositories need an automated way to discover the current repository's default branch name.

What git command returns that name?

1 Answers
Related