gjtorikian/no-more-masters

Support configuration of default branch

Closed this issue · 1 comments

The name production is opiniated, in our repositories this would not make sense and main would better fit. To avoid having to specify the default name on command line or to fork the project, I'd welcome the feature to configure it globally or per user. Best place to do so is .gitconfig:

[core]
    defaultBranch = main

The value can be read like this:

var defaultBranch = "production"
try {
    defaultBranch = (await execa("git", ["config", "--get", "core.defaultBranch"])).stdout
} catch (e) {
  if (e.exitCode !== 1) throw e // don't complain if key not set
}

Closed by #4