GNU/Linux xterm-256color zsh 211 views

Describe the feature or problem you’d like to solve By default repository creation uses master as the default branch name. I can set something like this in my ~/.gitconfig

git config –global alias.new ‘!git init && git symbolic-ref HEAD refs/heads/main’

I like the gh repo create flow though and would like to have it there. I know GitHub is already working on this issue in other areas and likely work is being discussed upstream in git will as well. Adding a flag in this tool seems to be a pretty quick win now.

Proposed solution Add a -b branch flag to repo create to allow folks to choose a different default branch. In the future there will be main, mainline, trunk, and whatever else comes. But starting today we can have something better then the current default.

Additional context I wanted to use this for my own workflow so I implemented it in my fork. You can how I did it here: metcalfc@2623c4a

Here is a recording of what the flow could look like. https://asciinema.org/a/339951

More recordings by metcalfc