Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.06 KB

File metadata and controls

44 lines (32 loc) · 1.06 KB

Git

Minimizing Merge Conflicts

Techniques for minimizing merge conflicts with collaborative git repos.

Default Branch Name

The default branch name of repos should be main, or otherwise not master.

The historical default branch name of master is not inclusive to all communities and should be avoided. GitHub and GitLab use main as the default branch for new repositories starting in 2020.

Git also provides a setting, since Git 2.28.0, to define the default branch name when using git init.

Set default branch by CLI:
$ git config set --global
Or editing a gitconfig file:
[init]
    defaultBranch = main

References: