init

NAME

git-init - Create an empty Git repository or reinitialize an existing onegit-init - 空のGitリポジトリを作成するか既存のリポジトリを再初期化する

SYNOPSIS概要

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.基本的には-このコマンドは、空のGitリポジトリ作成.git用のサブディレクトリを含むディレクトリobjectsrefs/headsrefs/tags、およびテンプレートファイルを。HEADマスターブランチのHEADを参照する初期ファイルも作成されます。

If the $GIT_DIR environment variable is set then it specifies a path to use instead of ./.git for the base of the repository.$GIT_DIR環境変数が設定されている場合は./.git、リポジトリのベースではなく使用するパスを指定します。

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.オブジェクト格納ディレクトリが$GIT_OBJECT_DIRECTORY環境変数で指定されている場合はsha1ディレクトリがその下に作成されます - それ以外の場合はデフォルトの$GIT_DIR/objectsディレクトリが使用されます。

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).既存のリポジトリでgit initを実行するのは安全です。すでに存在しているものを上書きすることはありません。git initを再実行する主な理由は、新しく追加されたテンプレートをピックアップすることです(または--separate-git-dirが指定されている場合はリポジトリを別の場所に移動すること)。

OPTIONSオプション

-q
--quiet - 静か

Only print error and warning messages; all other output will be suppressed.エラーメッセージと警告メッセージのみを表示します。他のすべての出力は抑制されます。

--bare - 裸

Create a bare repository. If GIT_DIR environment is not set, it is set to the current working directory.ベアリポジトリを作成します。GIT_DIRenvironmentが設定されていない場合は、現在の作業ディレクトリに設定されます。

--template=<template_directory> --template = <template_directory>

Specify the directory from which templates will be used. (See the "TEMPLATE DIRECTORY" section below.)テンプレートを使用するディレクトリを指定してください。(下記の「テンプレートディレクトリ」を参照してください。)

--separate-git-dir=<git dir> --separate-git-dir = <git dir>

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.リポジトリをいずれかのディレクトリとして初期化する代わりに、$GIT_DIRまたは./.git/実際のリポジトリへのパスを含むテキストファイルをそこに作成します。このファイルは、ファイルシステムに依存しないGitのリポジトリへのシンボリックリンクとして機能します。

If this is reinitialization, the repository will be moved to the specified path.これが再初期化されると、リポジトリは指定されたパスに移動されます。

--shared[=(false|true|umask|group|all|world|everybody|0xxx)] --shared [=(false | true | umask |グループ| all | world | everybody | 0xxx)]

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).Gitリポジトリを複数のユーザーで共有することを指定します。これにより、同じグループに属するユーザーはそのリポジトリにプッシュできます。指定すると、config変数 "core.sharedRepository"が設定され、その下にあるファイルとディレクトリ$GIT_DIRが要求された許可で作成されます。指定しない場合、Gitはumask(2)によって報告された許可を使用します。

The option can have the following values, defaulting to group if no value is given:オプションには以下の値を指定できます。値が指定されていない場合はデフォルトでgroupになります。

umask (or false) umask(またはfalse

Use permissions reported by umask(2). The default, when --shared is not specified.umask(2)によって報告された許可を使用してください。--shared指定しない場合のデフォルト。

group (or true) グループ(またはtrue

Make the repository group-writable, (and g+sx, since the git group may be not the primary group of all users). This is used to loosen the permissions of an otherwise safe umask(2) value. Note that the umask still applies to the other permission bits (e.g. if umask is 0022, using group will not remove read privileges from other (non-group) users). See 0xxx for how to exactly specify the repository permissions.リポジトリをグループ書き込み可能にします(そしてgitグループはすべてのユーザのプライマリグループではないかもしれないのでg + sx)。これは、安全なumask(2)値の許可を緩めるために使用されます。umaskは他の許可ビットにも適用されることに注意してください(たとえば、umaskが0022の場合、groupを使用しても他の(非グループ)ユーザーから読み取り特権は削除されません)。リポジトリのアクセス許可を正確に指定する方法については、0xxxを参照してください。

all (or world or everybody) すべて(または世界またはみんな

Same as group, but make the repository readable by all users.groupと同じですが、リポジトリをすべてのユーザーが読めるようにします。

0xxx

0xxx is an octal number and each file will have mode 0xxx. 0xxx will override users' umask(2) value (and not only loosen permissions as group and all does). 0640 will create a repository which is group-readable, but not group-writable or accessible to others. 0660 will create a repo that is readable and writable to the current user and group, but inaccessible to others.0xxxは8進数で、各ファイルはモード0xxxを持ちます。0xxxはユーザのumask(2)の値を上書きします(そしてグループとしてのパーミッションを失うだけでなく、すべてがそうします)。0640は、グループ読み取り可能なリポジトリを作成しますが、グループ書き込み可能または他の人がアクセスすることはできません。0660は、現在のユーザーとグループに対して読み取りおよび書き込みが可能で、他のユーザーにはアクセスできないリポジトリを作成します。

By default, the configuration flag receive.denyNonFastForwards is enabled in shared repositories, so that you cannot force a non fast-forwarding push into it.デフォルトでは、設定フラグreceive.denyNonFastForwardsは共有リポジトリで有効になっているため、早送り以外のプッシュを強制することはできません。

If you provide a directory, the command is run inside it. If this directory does not exist, it will be created.あなたが提供する場合は、ディレクトリを、コマンドは内部で実行されます。このディレクトリが存在しない場合は作成されます。

TEMPLATE DIRECTORYテンプレートディレクトリ

Files and directories in the template directory whose name do not start with a dot will be copied to the $GIT_DIR after it is created.名前がドットで始まらないテンプレートディレクトリ内のファイルおよびディレクトリは、作成$GIT_DIR後にコピーされます。

The template directory will be one of the following (in order):テンプレートディレクトリは、次のいずれかになります(順に)。

  • the argument given with the --template option;--templateオプションで与えられた引数。

  • the contents of the $GIT_TEMPLATE_DIR environment variable;$GIT_TEMPLATE_DIR環境変数の内容

  • the init.templateDir configuration variable; orinit.templateDir設定変数。または

  • the default template directory: /usr/share/git-core/templates.デフォルトのテンプレートディレクトリ:/usr/share/git-core/templates

The default template directory includes some directory structure, suggested "exclude patterns" (see gitignore[5]), and sample hook files.デフォルトのテンプレートディレクトリには、いくつかのディレクトリ構造、推奨される「除外パターン」(gitignore [5]を参照)、およびサンプルフックファイルが含まれています。

The sample hooks are all disabled by default. To enable one of the sample hooks rename it by removing its .sample suffix.サンプルフックはデフォルトですべて無効になっています。サンプルフックの1つを有効にするには、.sampleサフィックスを削除して名前を変更します。

See githooks[5] for more general info on hook execution.フック実行に関するより一般的な情報についてはgithooks [5]を参照してください。

EXAMPLES

Start a new Git repository for an existing code base 既存のコードベース用に新しいGitリポジトリを起動する
$ cd /path/to/my/codebase
$ git init      (1)
$ git add .     (2)
$ git commit    (3)
  1. Create a /path/to/my/codebase/.git directory./path/to/my/codebase/.gitディレクトリを作成します。

  2. Add all existing files to the index.既存のファイルをすべてインデックスに追加します。

  3. Record the pristine state as the first commit in the history.手付かずの状態を歴史の最初のコミットとして記録します。

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

長野県の電車路線、駅の一覧

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る