Documentation
¶
Overview ¶
Package init git-init - Create an empty Git repository or reinitialize an existing one.
SYNOPSIS ¶
Reference: https://git-scm.com/docs/git-init
git init [-q | --quiet] [--bare] [--template=<template_directory>] [--separate-git-dir <git dir>] [--shared[=<permissions>]] [directory]
DESCRIPTION ¶
This command creates an empty Git repository - basically a .git directory with subdirectories for objects, refs/heads, refs/tags, and template files. An initial HEAD file that references the HEAD of the master branch is also created.
If the $GIT_DIR environment variable is set then it specifies a path to use instead of ./.git for the base of the repository.
If the object storage directory is specified via the $GIT_OBJECT_DIRECTORY environment variable then the sha1 directories are created underneath - otherwise the default $GIT_DIR/objects directory is used.
Running git init in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunning git init is to pick up newly added templates (or to move the repository to another place if --separate-git-dir is given).
Index ¶
- func Bare(g *types.Cmd)
- func Directory(directory string) func(*types.Cmd)
- func Quiet(g *types.Cmd)
- func SeparateGitDir(gitDir string) func(*types.Cmd)
- func Shared(value string) func(*types.Cmd)
- func SharedWithPerms(permissions string) func(*types.Cmd)
- func Template(templateDirectory string) func(*types.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bare ¶
Bare Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory. --bare
func Quiet ¶
Quiet Only print error and warning messages; all other output will be suppressed. -q, --quiet
func SeparateGitDir ¶
SeparateGitDir Instead of initializing the repository as a directory to either $GIT_DIR or ./.git/, create a text file there containing the path to the actual repository. This file acts as filesystem-agnostic Git symbolic link to the repository. --separate-git-dir=<git dir>
func Shared ¶
Shared Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable 'core.sharedRepository' is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, Git will use permissions reported by umask(2). --shared[=(false|true|umask|group|all|world|everybody|0xxx)]
func SharedWithPerms ¶
SharedWithPerms Shared Specify that the Git repository is to be shared amongst several users. This allows users belonging to the same group to push into that repository. When specified, the config variable 'core.sharedRepository' is set so that files and directories under $GIT_DIR are created with the requested permissions. When not specified, Git will use permissions reported by umask(2). --shared[=(false|true|umask|group|all|world|everybody|0xxx)]
Types ¶
This section is empty.