init

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bare

func Bare(g *types.Cmd)

Bare Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory. --bare

func Directory

func Directory(directory string) func(*types.Cmd)

Directory path.

func Quiet

func Quiet(g *types.Cmd)

Quiet Only print error and warning messages; all other output will be suppressed. -q, --quiet

func SeparateGitDir

func SeparateGitDir(gitDir string) func(*types.Cmd)

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

func Shared(value string) func(*types.Cmd)

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

func SharedWithPerms(permissions string) func(*types.Cmd)

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)]

func Template

func Template(templateDirectory string) func(*types.Cmd)

Template Specify the directory from which templates will be used. (See the 'TEMPLATE DIRECTORY' section below.) --template=<template_directory>

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL