Closed
Description
Subject of the issue
Currently, GitHub suggest renaming of default branch from master
to main
https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/
But in ruby-git in many places master
used as the default branch https://github.com/ruby-git/ruby-git/blob/master/lib/git/base.rb#L345
My proposal to add new method git.default_branch
which will do git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' master
based on https://stackoverflow.com/a/44750379/902217
Your environment
- version of git and ruby-git 1.9.0
- version of ruby 2.6.7p197
Steps to reproduce
Expected behaviour
Have a possibility to get default branch
Actual behaviour
For now it's not possible to get default branch
Metadata
Metadata
Assignees
Labels
No labels