diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2020-06-24 14:46:32 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-24 09:14:21 -0700 |
commit | 32ba12dab2acf1ad11836a627956d1473f6b851a (patch) | |
tree | ca58c7b1e3224c5f816c6f0bf1327d873a798a40 /Documentation/git-init.txt | |
parent | 6069eccdc9d6351f1668b85551bbee4b6ca7cbb0 (diff) | |
download | git-32ba12dab2acf1ad11836a627956d1473f6b851a.tar.gz |
init: allow specifying the initial branch name for the new repository
There is a growing number of projects and companies desiring to change
the main branch name of their repositories (see e.g.
https://twitter.com/mislav/status/1270388510684598272 for background on
this).
To change that branch name for new repositories, currently the only way
to do that automatically is by copying all of Git's template directory,
then hard-coding the desired default branch name into the `.git/HEAD`
file, and then configuring `init.templateDir` to point to those copied
template files.
To make this process much less cumbersome, let's introduce a new option:
`--initial-branch=<branch-name>`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-init.txt')
-rw-r--r-- | Documentation/git-init.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt index f9467cc6a4..ddfe265da5 100644 --- a/Documentation/git-init.txt +++ b/Documentation/git-init.txt @@ -11,6 +11,7 @@ SYNOPSIS [verse] 'git init' [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--object-format=<format>] + [-b <branch-name> | --initial-branch=<branch-name>] [--shared[=<permissions>]] [directory] @@ -67,6 +68,12 @@ repository. + If this is reinitialization, the repository will be moved to the specified path. +-b <branch-name:: +--initial-branch=<branch-name>:: + +Use the specified name for the initial branch in the newly created repository. +If not specified, fall back to the default name: `master`. + --shared[=(false|true|umask|group|all|world|everybody|0xxx)]:: Specify that the Git repository is to be shared amongst several users. This |