Change global branch to main in Ubuntu 20

Asked

Viewed 48 times

-1

How do I permanently (globally) change the git branch from "master" to "main" in Ubuntu 20?

1 answer

1


The command git-config allows this. The parameter init.defaultBranch, as the documentation says, it allows you to define another name for the branch used in the creation of a new repository or when you clone an existing repository. The scope of this definition depends on the modifier used (-system, -global, -worktree, -file or --local).

Of documentation https://git-scm.com/docs/git-config

init.defaultBranch
  Allows overriding the default branch name e.g. when initializing a new repository or 
  when cloning an empty repository.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.