✓ Works

git ≥ 2.28: init.defaultBranch Configuration Available

git ≥ 2.28 + init.defaultBranch configuration

`init.defaultBranch` was introduced in git 2.28.0 (July 2020). It allows configuring the default branch name for new repositories (e.g. set to `main` instead of `master`). Set globally with `git config --global init.defaultBranch main`. git versions before 2.28 always create `master` regardless of config.

Related Error Pages

Related Combinations

git 2.43 + Ubuntu 24.04 LTS ✓ Works git 2.34 + Ubuntu 22.04 LTS ✓ Works git 2.25 + Ubuntu 20.04 LTS ⚠ Partial git 2.17 + Ubuntu 18.04 LTS ⚠ Partial
Last verified: 2024-06-01  ·  Category: git + OS / Features