aboutsummaryrefslogtreecommitdiff
path: root/roles/git
diff options
context:
space:
mode:
Diffstat (limited to 'roles/git')
-rwxr-xr-xroles/git/files/gitolite-cgit/entrypoint.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/git/files/gitolite-cgit/entrypoint.sh b/roles/git/files/gitolite-cgit/entrypoint.sh
index 873a0ac..3ad094f 100755
--- a/roles/git/files/gitolite-cgit/entrypoint.sh
+++ b/roles/git/files/gitolite-cgit/entrypoint.sh
@@ -21,6 +21,12 @@ if [ ! -f /var/lib/git/.ssh/authorized_keys ]; then
echo "${SSH_KEY}" > /tmp/admin.pub
su - git -c 'gitolite setup --pubkey /tmp/admin.pub'
rm -f /tmp/admin.pub
+
+ # Change default git branch.
+ # IMPORTANT:
+ # Only do this after gitolite is initialized, as gitolite only applies
+ # changes made to the *master* branch in the gitolite-admin repository.
+ su - git -c 'git config --global init.defaultBranch main'
else
# Fixup gitolite, eg in case a new repo was added manually.
su - git -c 'gitolite setup'