From 346960f313c01afee62dcab90a8e4a1bc5386211 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 25 Jul 2023 20:24:47 +0100 Subject: [PATCH] feat(git): set the default branch name for new ...repositories When running `git init` to initialise a new repository, set the default branch name that will be used. In this case, the branch name will be `main` instead of the old default, `master`. --- home-manager/modules/git.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/git.nix b/home-manager/modules/git.nix index ca13950..6975727 100644 --- a/home-manager/modules/git.nix +++ b/home-manager/modules/git.nix @@ -92,7 +92,10 @@ fetch.prune = true; grep.lineNumber = true; help.autocorrect = "1"; - init.templatedir = "~/.git_template"; + init = { + defaultBranch = "main"; + templatedir = "~/.git_template"; + }; merge.ff = "only"; rebase = { autosquash = true;