From 56d614f8067c275f4d7b53f3f3a30a5effbeded9 Mon Sep 17 00:00:00 2001 From: Joe Ferris Date: Fri, 19 Jun 2020 14:08:12 -0400 Subject: [PATCH] Initialize new repositories with a main branch New Git repositories start out without any branches, but the HEAD reference points to "master" by default. This means that the first commit will create a master branch. This change adds a HEAD file to the Git template with a different ref. This means that new repositories will commit to a "main" branch by default instead. The HEAD file is added to COPY_ALWAYS, because Git's HEAD must be a regular file and not a symbolic link. --- git_template/HEAD | 1 + rcrc | 1 + 2 files changed, 2 insertions(+) create mode 100644 git_template/HEAD diff --git a/git_template/HEAD b/git_template/HEAD new file mode 100644 index 0000000..b870d82 --- /dev/null +++ b/git_template/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/rcrc b/rcrc index 92bdb30..b8e5082 100644 --- a/rcrc +++ b/rcrc @@ -1,2 +1,3 @@ EXCLUDES="README*.md LICENSE" DOTFILES_DIRS="$HOME/dotfiles-local $HOME/dotfiles" +COPY_ALWAYS="git_template/HEAD"