I have a shell script that runs over a Git repository, and it compares the current branch to the default branch.
Right now it's hard-coded to master
, but I need it to be dynamic to whatever the default/main branch of the repo is.
Is there a command to get the default branch of a repo, without using the GitHub API?