grit icon indicating copy to clipboard operation
grit copied to clipboard

Honour `init.defaultBranch` configuration value.

Open jmalloc opened this issue 3 years ago • 1 comments

The primary driver behind this is to create main branches for GitHub repositories, instead of master.

As it stands go-git is hardcoded to make a master branch. I have created https://github.com/go-git/go-git/issues/269 to see if a fix for this would be appropriate & welcome upstream. Failing that we should be able to workaround that by using the lower level initialization functions, or even by removing the master symref and creating a different one after calling Init().

Looking further ahead, for GitHub specifically, we could use the GitHub API to check what the actual default branch name will be (see #57).

/cc @ezzatron

jmalloc avatar Mar 18 '21 07:03 jmalloc

See also https://github.com/go-git/go-git/issues/249#issuecomment-772354474

jmalloc avatar Aug 16 '21 02:08 jmalloc