submodule
NAME名
git-submodule - Initialize, update or inspect submodulesgit-submodule - サブモジュールの初期化、更新、検査
SYNOPSIS概要
git submodule [--quiet] add [<options>] [--] <repository> [<path>] git submodule [--quiet] status [--cached] [--recursive] [--] [<path>…] git submodule [--quiet] init [--] [<path>…] git submodule [--quiet] deinit [-f|--force] (--all|[--] <path>…) git submodule [--quiet] update [<options>] [--] [<path>…] git submodule [--quiet] summary [<options>] [--] [<path>…] git submodule [--quiet] foreach [--recursive] <command> git submodule [--quiet] sync [--recursive] [--] [<path>…] git submodule [--quiet] absorbgitdirs [--] [<path>…]
DESCRIPTION説明
Inspects, updates and manages submodules.サブモジュールを検査、更新、管理します。
For more information about submodules, see gitsubmodules[7].サブモジュールの詳細については、gitsubmodules [7]を参照してください。
COMMANDSコマンド
- add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--depth <depth>] [--] <repository> [<path>] add [-b <branch>] [-f | --force] [--name <name>] [--reference <repository>] [--depth <depth>] [ - ] <repository> [<path >]
-
Add the given repository as a submodule at the given path to the changeset to be committed next to the current project: the current project is termed the "superproject".現在のプロジェクトの隣にコミットされるチェンジセットへの指定されたパスに、指定されたリポジトリをサブモジュールとして追加します。現在のプロジェクトは「スーパープロジェクト」と呼ばれます。
<repository> is the URL of the new submodule’s origin repository. This may be either an absolute URL, or (if it begins with ./ or ../), the location relative to the superproject’s default remote repository (Please note that to specify a repository foo.git which is located right next to a superproject bar.git, you’ll have to use ../foo.git instead of ./foo.git - as one might expect when following the rules for relative URLs - because the evaluation of relative URLs in Git is identical to that of relative directories).<repository>は、新しいサブモジュールの起点リポジトリのURLです。これは、絶対URL、または(./または../で始まる場合は)スーパープロジェクトのデフォルトのリモートリポジトリを基準とした場所のいずれかです(スーパープロジェクトのすぐ隣にあるリポジトリfoo.gitを指定することに注意してください)。bar.git、あなたが使用する必要があります../foo.gitをするのではなく、./foo.gitの相対URLのルールを以下のとき1想像のとおり- - Gitリポジトリ内の相対URLの評価は相対的のものと同じであるため、ディレクトリ)。
The default remote is the remote of the remote-tracking branch of the current branch. If no such remote-tracking branch exists or the HEAD is detached, "origin" is assumed to be the default remote. If the superproject doesn’t have a default remote configured the superproject is its own authoritative upstream and the current working directory is used instead.デフォルトのremoteは、現在のブランチのリモート追跡ブランチのリモートです。そのようなリモート追跡ブランチが存在しないか、HEADが切り離されている場合、 "origin"がデフォルトのリモートと見なされます。スーパープロジェクトにデフォルトのリモートが設定されていない場合、スーパープロジェクトはそれ自身の権威ある上流であり、代わりに現在の作業ディレクトリが使用されます。
The optional argument <path> is the relative location for the cloned submodule to exist in the superproject. If <path> is not given, the canonical part of the source repository is used ("repo" for "/path/to/repo.git" and "foo" for "host.xz:foo/.git"). If <path> exists and is already a valid Git repository, then it is staged for commit without cloning. The <path> is also used as the submodule’s logical name in its configuration entries unless
--name
is used to specify a logical name.オプションの引数<path>は、スーパープロジェクト内に存在するクローンサブモジュールの相対位置です。<path>が指定されていない場合は、ソースリポジトリの正規の部分が使用されます( "/path/to/repo.git"の場合は "repo"、 "host.xz:foo / .git"の場合は "foo")。<path>が存在し、それがすでに有効なGitリポジトリである場合は、クローンを作成せずにコミット用にステージングされます。<path>は--name
、論理名を指定するために使用されていない限り、その構成エントリー内でサブモジュールの論理名としても使用されます。The given URL is recorded into
.gitmodules
for use by subsequent users cloning the superproject. If the URL is given relative to the superproject’s repository, the presumption is the superproject and submodule repositories will be kept together in the same relative location, and only the superproject’s URL needs to be provided. git-submodule will correctly locate the submodule using the relative URL in.gitmodules
.指定されたURLは.gitmodules
、スーパープロジェクトを複製する後続のユーザーによる使用のために記録されます。URLがスーパープロジェクトのリポジトリを基準にして指定されている場合、スーパープロジェクトとサブモジュールのリポジトリは同じ相対位置にまとめられ、スーパープロジェクトのURLのみを指定する必要があります。git-submoduleは、の相対URLを使用してサブモジュールを正しく見つけます.gitmodules
。 - status [--cached] [--recursive] [--] [<path>…] status [--cached] [--recursive] [ - ] [<path>…]
-
Show the status of the submodules. This will print the SHA-1 of the currently checked out commit for each submodule, along with the submodule path and the output of git describe for the SHA-1. Each SHA-1 will possibly be prefixed with
-
if the submodule is not initialized,+
if the currently checked out submodule commit does not match the SHA-1 found in the index of the containing repository andU
if the submodule has merge conflicts.サブモジュールのステータスを表示します。これは、サブモジュールパスとSHA-1のgit describeの出力とともに、各サブモジュールの現在チェックアウトされているコミットのSHA-1を出力します。-
サブモジュールが初期化+
されていない場合、現在チェックアウトされているサブモジュールのコミットが含まれているリポジトリのインデックスにあるSHA-1と一致しないU
場合、およびサブモジュールにマージ競合がある場合は、各SHA-1にプレフィックスが付きます。If
--recursive
is specified, this command will recurse into nested submodules, and show their status as well.--recursive
が指定された場合、このコマンドはネストされたサブモジュールに再帰的に現れ、それらのステータスも表示します。If you are only interested in changes of the currently initialized submodules with respect to the commit recorded in the index or the HEAD, git-status[1] and git-diff[1] will provide that information too (and can also report changes to a submodule’s work tree).インデックスまたはHEADに記録されたコミットに関して現在初期化されているサブモジュールの変更のみに関心がある場合は、git-status [1]およびgit-diff [1]もその情報を提供します(またサブモジュールの作業ツリー
- init [--] [<path>…] init [ - ] [<path>…]
-
Initialize the submodules recorded in the index (which were added and committed elsewhere) by setting
submodule.$name.url
in .git/config. It uses the same setting from.gitmodules
as a template. If the URL is relative, it will be resolved using the default remote. If there is no default remote, the current repository will be assumed to be upstream.submodule.$name.url
.git / configに設定して、インデックスに記録されているサブモジュール(他の場所で追加されコミットされたもの)を初期化します。.gitmodules
テンプレートと同じ設定を使用します。URLが相対URLの場合は、デフォルトのリモートを使用して解決されます。デフォルトのリモートがない場合、現在のリポジトリは上流にあると見なされます。Optional <path> arguments limit which submodules will be initialized. If no path is specified and submodule.active has been configured, submodules configured to be active will be initialized, otherwise all submodules are initialized.オプションの<path>引数は、どのサブモジュールを初期化するかを制限します。パスが指定されておらず、submodule.activeが設定されている場合は、activeに設定されているサブモジュールが初期化されます。それ以外の場合は、すべてのサブモジュールが初期化されます。
When present, it will also copy the value of
submodule.$name.update
. This command does not alter existing information in .git/config. You can then customize the submodule clone URLs in .git/config for your local setup and proceed togit submodule update
; you can also just usegit submodule update --init
without the explicit init step if you do not intend to customize any submodule locations.存在する場合は、の値もコピーされますsubmodule.$name.update
。このコマンドは、.git / config内の既存の情報を変更しません。その後、ローカルセットアップ用に.git / config内のサブモジュールクローンURLをカスタマイズしてに進みgit submodule update
ます。サブモジュールの場所をカスタマイズしないのであればgit submodule update --init
、明示的なinitステップなしで使用することもできます。See the add subcommand for the definition of default remote.デフォルトのリモートの定義については、addサブコマンドを参照してください。
- deinit [-f|--force] (--all|[--] <path>…) deinit [-f | --force](--all | [ - ] <path>…)
-
Unregister the given submodules, i.e. remove the whole
submodule.$name
section from .git/config together with their work tree. Further calls togit submodule update
,git submodule foreach
andgit submodule sync
will skip any unregistered submodules until they are initialized again, so use this command if you don’t want to have a local checkout of the submodule in your working tree anymore.与えられたサブモジュールの登録を解除します。すなわち、そのsubmodule.$name
セクション全体を.git / configからそれらの作業ツリーと一緒に削除します。登録されていないサブモジュールを再度初期化するまで呼び出しgit submodule update
、git submodule foreach
そしてgit submodule sync
未登録のサブモジュールをスキップします。したがって、作業ツリーでサブモジュールをローカルにチェックアウトしたくない場合は、このコマンドを使用してください。When the command is run without pathspec, it errors out, instead of deinit-ing everything, to prevent mistakes.pathspecを指定せずにコマンドを実行すると、間違いを防ぐために、すべてを初期化するのではなくエラーが発生します。
If
--force
is specified, the submodule’s working tree will be removed even if it contains local modifications.場合は--force
、指定され、サブモジュールの作業ツリーは、それがローカルの変更が含まれている場合でも削除されます。If you really want to remove a submodule from the repository and commit that use git-rm[1] instead. See gitsubmodules[7] for removal options.本当にリポジトリからサブモジュールを削除してコミットする場合は、代わりにgit-rm [1]を使用してください。削除オプションについてはgitsubmodules [7]を参照してください。
- update [--init] [--remote] [-N|--no-fetch] [--[no-]recommend-shallow] [-f|--force] [--checkout|--rebase|--merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [--] [<path>…] update [--init] [--remote] [-N | --no-fetch] [ - [no-] recommend-shallow] [-f | --force] [--checkout | --rebase | - -merge] [--reference <repository>] [--depth <depth>] [--recursive] [--jobs <n>] [ - ] [<path>…]
-
Update the registered submodules to match what the superproject expects by cloning missing submodules and updating the working tree of the submodules. The "updating" can be done in several ways depending on command line options and the value of
submodule.<name>.update
configuration variable. The command line option takes precedence over the configuration variable. If neither is given, a checkout is performed. The update procedures supported both from the command line as well as through thesubmodule.<name>.update
configuration are:見つからないサブモジュールを複製し、サブモジュールの作業ツリーを更新することによって、スーパープロジェクトが期待するものと一致するように、登録されたサブモジュールを更新します。「更新」は、コマンドラインオプションとsubmodule.<name>.update
設定変数の値に応じていくつかの方法で行うことができます。コマンドラインオプションは設定変数よりも優先されます。どちらも指定されていない場合は、チェックアウトが実行されます。更新コマンドラインから、ならびにを通して両方サポートされる手順submodule.<name>.update
の構成は次のとおりです。- checkout チェックアウト
-
the commit recorded in the superproject will be checked out in the submodule on a detached HEAD.スーパープロジェクトに記録されたコミットは、切り離されたHEADのサブモジュールでチェックアウトされます。
If
--force
is specified, the submodule will be checked out (usinggit checkout --force
), even if the commit specified in the index of the containing repository already matches the commit checked out in the submodule.場合は--force
、指定され、サブモジュールは、(使用してチェックアウトされますgit checkout --force
)を含むリポジトリのインデックスで指定されたコミットしても、すでにコミットはサブモジュールでチェックアウトと一致します。 - rebase リベース
-
the current branch of the submodule will be rebased onto the commit recorded in the superproject.サブモジュールの現在のブランチは、スーパープロジェクトに記録されているコミットにリベースされます。
- merge マージ
-
the commit recorded in the superproject will be merged into the current branch in the submodule.スーパープロジェクトに記録されたコミットは、サブモジュールの現在のブランチにマージされます。
The following update procedures are only available via the
submodule.<name>.update
configuration variable:以下の更新手順は、submodule.<name>.update
構成変数を介してのみ利用可能です。- custom command カスタムコマンド
-
arbitrary shell command that takes a single argument (the sha1 of the commit recorded in the superproject) is executed. When
submodule.<name>.update
is set to !command, the remainder after the exclamation mark is the custom command.単一の引数(スーパープロジェクトに記録されたコミットのsha1)をとる任意のシェルコマンドが実行されます。submodule.<name>.update
が!commandに設定されている場合、感嘆符の後の残りはカスタムコマンドです。 - none 無し
-
the submodule is not updated.サブモジュールは更新されません。
If the submodule is not yet initialized, and you just want to use the setting as stored in
.gitmodules
, you can automatically initialize the submodule with the--init
option.サブモジュールがまだ初期化されておらず、保存されている設定をそのまま使用する.gitmodules
場合は、--init
オプションを使用してサブモジュールを自動的に初期化できます。If
--recursive
is specified, this command will recurse into the registered submodules, and update any nested submodules within.--recursive
が指定された場合、このコマンドは登録されたサブモジュールに再帰し、その中のネストされたサブモジュールをすべて更新します。 - summary [--cached|--files] [(-n|--summary-limit) <n>] [commit] [--] [<path>…] summary [--cached | --files] [(-n | --summary-limit)<n>] [commit] [ - ] [<path>…]
-
Show commit summary between the given commit (defaults to HEAD) and working tree/index. For a submodule in question, a series of commits in the submodule between the given super project commit and the index or working tree (switched by
--cached
) are shown. If the option--files
is given, show the series of commits in the submodule between the index of the super project and the working tree of the submodule (this option doesn’t allow to use the--cached
option or to provide an explicit commit).与えられたコミット(デフォルトはHEAD)と作業ツリー/インデックスの間のコミットの要約を表示します。問題のサブモジュールについて、与えられたスーパープロジェクトコミットとインデックスまたは作業ツリー(切り替えられた--cached
)の間のサブモジュール内の一連のコミットが表示されます。オプション--files
が指定されている場合、スーパープロジェクトのインデックスとサブモジュールの作業ツリーの間のサブモジュール内の一連のコミットを表示します(このオプションは--cached
オプションの使用や明示的なコミットの提供を許可しません)。Using the
--submodule=log
option with git-diff[1] will provide that information too.git-diff [1]でこの--submodule=log
オプションを使用すると、その情報も提供されます。 - foreach [--recursive] <command> foreach [--recursive] <コマンド>
-
Evaluates an arbitrary shell command in each checked out submodule. The command has access to the variables $name, $sm_path, $displaypath, $sha1 and $toplevel: $name is the name of the relevant submodule section in
.gitmodules
, $sm_path is the path of the submodule as recorded in the immediate superproject, $displaypath contains the relative path from the current working directory to the submodules root directory, $sha1 is the commit as recorded in the immediate superproject, and $toplevel is the absolute path to the top-level of the immediate superproject. Note that to avoid conflicts with $PATH on Windows, the $path variable is now a deprecated synonym of $sm_path variable. Any submodules defined in the superproject but not checked out are ignored by this command. Unless given--quiet
, foreach prints the name of each submodule before evaluating the command. If--recursive
is given, submodules are traversed recursively (i.e. the given shell command is evaluated in nested submodules as well). A non-zero return from the command in any submodule causes the processing to terminate. This can be overridden by adding || : to the end of the command.チェックアウトされた各サブモジュール内の任意のシェルコマンドを評価します。このコマンドは、変数$ name、$ sm_path、$ displaypath、$ sha1、および$ toplevelにアクセスできます。$ nameは、関連するサブモジュールセクションの名前です.gitmodules
。$ sm_pathは、直接スーパープロジェクトに記録されたサブモジュールのパスです。 displaypathには、現在の作業ディレクトリからサブモジュールのルートディレクトリへの相対パスが含まれ、$ sha1は即時スーパープロジェクトに記録されているコミット、$ toplevelは直接スーパープロジェクトの最上位レベルへの絶対パスです。Windows上の$ PATHとの競合を避けるために、$ path変数は$ sm_pathの非推奨同義語になりました。変数。スーパープロジェクトで定義されているがチェックアウトされていないサブモジュールは、このコマンドでは無視されます。指定しない限り--quiet
、foreachはコマンドを評価する前に各サブモジュールの名前を表示します。場合は--recursive
指定され、サブモジュール(すなわち与えられたシェルコマンドは、同様に、ネストされたサブモジュールで評価される)を再帰的に横断しています。いずれかのサブモジュール内のコマンドからゼロ以外の値が返されると、処理は終了します。これは||を追加することで上書きできます。:コマンドの最後までAs an example, the command below will show the path and currently checked out commit for each submodule:例として、以下のコマンドは各サブモジュールのパスと現在チェックアウトされているコミットを表示します。
git submodule foreach 'echo $path `git rev-parse HEAD`'
- sync [--recursive] [--] [<path>…] sync [--recursive] [ - ] [<path>…]
-
Synchronizes submodules' remote URL configuration setting to the value specified in
.gitmodules
. It will only affect those submodules which already have a URL entry in .git/config (that is the case when they are initialized or freshly added). This is useful when submodule URLs change upstream and you need to update your local repositories accordingly.サブモジュールのリモートURL構成設定をで指定された値に同期させます.gitmodules
。これは、.git / configにURLエントリがすでにあるサブモジュールにのみ影響します(つまり、初期化された、または新しく追加された場合)。これは、サブモジュールのURLがアップストリームに変更され、それに応じてローカルリポジトリを更新する必要がある場合に役立ちます。git submodule sync
synchronizes all submodules whilegit submodule sync -- A
synchronizes submodule "A" only.git submodule sync
git submodule sync -- A
サブモジュール "A"のみを同期化しながら、すべてのサブモジュールを同期化します。If
--recursive
is specified, this command will recurse into the registered submodules, and sync any nested submodules within.--recursive
が指定されている場合、このコマンドは登録されたサブモジュールに再帰し、その中のネストされたサブモジュールをすべて同期します。 - absorbgitdirs アブストラクト
-
If a git directory of a submodule is inside the submodule, move the git directory of the submodule into its superprojects
$GIT_DIR/modules
path and then connect the git directory and its working directory by setting thecore.worktree
and adding a .git file pointing to the git directory embedded in the superprojects git directory.サブモジュールのgitディレクトリがサブモジュール内にある場合は、サブモジュールのgitディレクトリをスーパープロジェクトの$GIT_DIR/modules
パスに移動してから、に設定し、その中にcore.worktree
埋め込まれているgitディレクトリを指す.gitファイルを追加して、gitディレクトリと作業ディレクトリを接続します。スーパープロジェクトのgitディレクトリ。A repository that was cloned independently and later added as a submodule or old setups have the submodules git directory inside the submodule instead of embedded into the superprojects git directory.独立してクローン化され、後でサブモジュールまたは古いセットアップとして追加されたリポジトリは、スーパープロジェクトのgitディレクトリに埋め込まれるのではなく、サブモジュールの中にサブモジュールのgitディレクトリを持ちます。
This command is recursive by default.このコマンドはデフォルトでは再帰的です。
OPTIONSオプション
- -q
- --quiet - 静か
-
Only print error messages.エラーメッセージのみを表示します。
- --progress - 進捗
-
This option is only valid for add and update commands. Progress status is reported on the standard error stream by default when it is attached to a terminal, unless -q is specified. This flag forces progress status even if the standard error stream is not directed to a terminal.このオプションは追加および更新コマンドにのみ有効です。-qが指定されていない限り、進行状況は端末に接続されたときにデフォルトで標準エラー・ストリームに報告されます。このフラグは、標準エラーストリームが端末に向けられていなくても進行状況を強制します。
- --all - すべて
-
This option is only valid for the deinit command. Unregister all submodules in the working tree.このオプションはdeinitコマンドにのみ有効です。作業ツリー内のすべてのサブモジュールを登録解除します。
- -b
- --branch - ブランチ
-
Branch of repository to add as submodule. The name of the branch is recorded as
submodule.<name>.branch
in.gitmodules
forupdate --remote
. A special value of.
is used to indicate that the name of the branch in the submodule should be the same name as the current branch in the current repository.サブモジュールとして追加するリポジトリのブランチ。枝の名前はforのようsubmodule.<name>.branch
に記録されます。サブモジュール内のブランチの名前は、現在のリポジトリ内の現在のブランチと同じ名前にする必要があることを示すために、特別な値が使用されます。.gitmodules
update --remote
.
- -f
- --force - 力
-
This option is only valid for add, deinit and update commands. When running add, allow adding an otherwise ignored submodule path. When running deinit the submodule working trees will be removed even if they contain local changes. When running update (only effective with the checkout procedure), throw away local changes in submodules when switching to a different commit; and always run a checkout operation in the submodule, even if the commit listed in the index of the containing repository matches the commit checked out in the submodule.このオプションはadd、deinit、およびupdateコマンドにのみ有効です。addを実行するときに、他の方法で無視されるサブモジュールパスを追加することを許可します。deinitを実行すると、サブモジュールの作業ツリーはローカルの変更を含んでいても削除されます。更新を実行するとき(チェックアウト手順でのみ有効)、別のコミットに切り替えるときにサブモジュール内のローカルの変更を破棄します。それを含むリポジトリーの索引にリストされているコミットがサブモジュールでチェックアウトされているコミットと一致する場合でも、必ずサブモジュールでチェックアウト操作を実行してください。
- --cached - キャッシュ
-
This option is only valid for status and summary commands. These commands typically use the commit found in the submodule HEAD, but with this option, the commit stored in the index is used instead.このオプションは、ステータスおよび要約コマンドに対してのみ有効です。これらのコマンドは通常、サブモジュールHEADにあるコミットを使用しますが、このオプションを指定すると、代わりにインデックスに格納されているコミットが使用されます。
- --files - ファイル
-
This option is only valid for the summary command. This command compares the commit in the index with that in the submodule HEAD when this option is used.このオプションはsummaryコマンドにのみ有効です。このオプションを使用すると、このコマンドはインデックス内のコミットとサブモジュールHEAD内のコミットを比較します。
- -n
- --summary-limit
-
This option is only valid for the summary command. Limit the summary size (number of commits shown in total). Giving 0 will disable the summary; a negative number means unlimited (the default). This limit only applies to modified submodules. The size is always limited to 1 for added/deleted/typechanged submodules.このオプションはsummaryコマンドにのみ有効です。サマリーサイズ(合計で表示されるコミット数)を制限します。0を指定すると要約は無効になります。負の数は無制限を意味します(デフォルト)。この制限は、変更されたサブモジュールにのみ適用されます。追加/削除/タイプ変更されたサブモジュールのサイズは常に1に制限されています。
- --remote - リモート
-
This option is only valid for the update command. Instead of using the superproject’s recorded SHA-1 to update the submodule, use the status of the submodule’s remote-tracking branch. The remote used is branch’s remote (
branch.<name>.remote
), defaulting toorigin
. The remote branch used defaults tomaster
, but the branch name may be overridden by setting thesubmodule.<name>.branch
option in either.gitmodules
or.git/config
(with.git/config
taking precedence).このオプションはupdateコマンドに対してのみ有効です。スーパープロジェクトの記録済みSHA-1を使用してサブモジュールを更新する代わりに、サブモジュールのリモートトラッキングブランチのステータスを使用してください。使用されているリモートはブランチのremote(branch.<name>.remote
)で、デフォルトであるorigin
。リモートブランチは、デフォルトを使用しmaster
ますが、支店名を設定することで上書きすることができるsubmodule.<name>.branch
のいずれかのオプションを.gitmodules
か.git/config
(と.git/config
優先して)。This works for any of the supported update procedures (
--checkout
,--rebase
, etc.). The only change is the source of the target SHA-1. For example,submodule update --remote --merge
will merge upstream submodule changes into the submodules, whilesubmodule update --merge
will merge superproject gitlink changes into the submodules.これはサポートされているアップデート手順(のいずれかのために働く--checkout
、--rebase
など)。唯一の変更はターゲットSHA-1のソースです。たとえば、submodule update --remote --merge
上流のサブモジュールの変更をサブモジュールにsubmodule update --merge
マージし、スーパープロジェクトのgitlinkの変更をサブモジュールにマージします。In order to ensure a current tracking branch state,
update --remote
fetches the submodule’s remote repository before calculating the SHA-1. If you don’t want to fetch, you should usesubmodule update --remote --no-fetch
.現在のトラッキングブランチの状態を確実にするためにupdate --remote
、SHA-1を計算する前にサブモジュールのリモートリポジトリを取得します。取得したくない場合はを使用してくださいsubmodule update --remote --no-fetch
。Use this option to integrate changes from the upstream subproject with your submodule’s current HEAD. Alternatively, you can run
git pull
from the submodule, which is equivalent except for the remote branch name:update --remote
uses the default upstream repository andsubmodule.<name>.branch
, whilegit pull
uses the submodule’sbranch.<name>.merge
. Prefersubmodule.<name>.branch
if you want to distribute the default upstream branch with the superproject andbranch.<name>.merge
if you want a more native feel while working in the submodule itself.このオプションを使用して、上流のサブプロジェクトからの変更をサブモジュールの現在のHEADと統合します。別の方法としてgit pull
、サブモジュールから実行することもできます。これは、リモートブランチ名を除いて同等update --remote
です。デフォルトのアップストリームリポジトリsubmodule.<name>.branch
をgit pull
使用し、サブモジュールを使用しbranch.<name>.merge
ます。好むsubmodule.<name>.branch
あなたが親プロジェクトで、デフォルト上流分岐を配布する場合branch.<name>.merge
、サブモジュール自体での作業中に、あなたがより多くのネイティブな感触をしたい場合。 - -N
- --no-fetch
-
This option is only valid for the update command. Don’t fetch new objects from the remote site.このオプションはupdateコマンドに対してのみ有効です。リモートサイトから新しいオブジェクトを取得しないでください。
- --checkout - チェックアウト
-
This option is only valid for the update command. Checkout the commit recorded in the superproject on a detached HEAD in the submodule. This is the default behavior, the main use of this option is to override
submodule.$name.update
when set to a value other thancheckout
. If the keysubmodule.$name.update
is either not explicitly set or set tocheckout
, this option is implicit.このオプションはupdateコマンドに対してのみ有効です。サブプロジェクト内のデタッチされたHEADのスーパープロジェクトに記録されたコミットをチェックアウトします。これがデフォルトの動作です。このオプションの主な用途は、submodule.$name.update
以外の値に設定されたときにオーバーライドすることcheckout
です。キーsubmodule.$name.update
が明示的に設定されていないかに設定されているcheckout
場合、このオプションは暗黙的です。 - --merge - マージ
-
This option is only valid for the update command. Merge the commit recorded in the superproject into the current branch of the submodule. If this option is given, the submodule’s HEAD will not be detached. If a merge failure prevents this process, you will have to resolve the resulting conflicts within the submodule with the usual conflict resolution tools. If the key
submodule.$name.update
is set tomerge
, this option is implicit.このオプションはupdateコマンドに対してのみ有効です。スーパープロジェクトに記録されているコミットをサブモジュールの現在のブランチにマージします。このオプションが与えられると、サブモジュールのHEADは切り離されません。マージの失敗によってこのプロセスが妨げられる場合は、通常の競合解決ツールを使用してサブモジュール内で発生した競合を解決する必要があります。キーsubmodule.$name.update
がに設定されているmerge
場合、このオプションは暗黙的です。 - --rebase
-
This option is only valid for the update command. Rebase the current branch onto the commit recorded in the superproject. If this option is given, the submodule’s HEAD will not be detached. If a merge failure prevents this process, you will have to resolve these failures with git-rebase[1]. If the key
submodule.$name.update
is set torebase
, this option is implicit.このオプションはupdateコマンドに対してのみ有効です。現在のブランチをスーパープロジェクトに記録されているコミットに再配置します。このオプションが与えられると、サブモジュールのHEADは切り離されません。マージが失敗してこのプロセスが妨げられる場合、git-rebase [1]を使ってこれらの失敗を解決しなければなりません。キーsubmodule.$name.update
がに設定されているrebase
場合、このオプションは暗黙的です。 - --init - その中に
-
This option is only valid for the update command. Initialize all submodules for which "git submodule init" has not been called so far before updating.このオプションはupdateコマンドに対してのみ有効です。更新前に "git submodule init"が呼び出されていないサブモジュールをすべて初期化します。
- --name - 名
-
This option is only valid for the add command. It sets the submodule’s name to the given string instead of defaulting to its path. The name must be valid as a directory name and may not end with a /.このオプションはaddコマンドに対してのみ有効です。サブモジュールのパスをデフォルトにするのではなく、サブモジュールの名前を指定された文字列に設定します。名前はディレクトリ名として有効でなければならず、/で終わってはいけません。
- --reference <repository> --reference <リポジトリ>
-
This option is only valid for add and update commands. These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git-clone[1] command.このオプションは追加および更新コマンドにのみ有効です。これらのコマンドは時々リモートリポジトリをクローンする必要があります。この場合、このオプションはgit-clone [1]コマンドに渡されます。
NOTE: Do not use this option unless you have read the note for git-clone[1]'s
--reference
,--shared
, and--dissociate
options carefully.注:くださいではないあなたのためのノートを読んでいない限り、このオプションを使用するgitのクローン[1]さん--reference
、--shared
と--dissociate
慎重なオプション。 - --dissociate - 解体する
-
This option is only valid for add and update commands. These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git-clone[1] command.このオプションは追加および更新コマンドにのみ有効です。これらのコマンドは時々リモートリポジトリをクローンする必要があります。この場合、このオプションはgit-clone [1]コマンドに渡されます。
NOTE: see the NOTE for the
--reference
option.注:--reference
オプションについては注を参照してください。 - --recursive - 再帰的
-
This option is only valid for foreach, update, status and sync commands. Traverse submodules recursively. The operation is performed not only in the submodules of the current repo, but also in any nested submodules inside those submodules (and so on).このオプションはforeach、update、status、syncコマンドに対してのみ有効です。サブモジュールを再帰的にたどります。この操作は、現在のリポジトリのサブモジュールだけでなく、それらのサブモジュール内のネストされたサブモジュール(など)でも実行されます。
- --depth
-
This option is valid for add and update commands. Create a shallow clone with a history truncated to the specified number of revisions. See git-clone[1]このオプションは追加および更新コマンドに有効です。指定したリビジョン数まで切り捨てられた履歴を持つ、シャロークローンを作成します。git-cloneを見る[1]
- --[no-]recommend-shallow - [no-] recommend-shallow
-
This option is only valid for the update command. The initial clone of a submodule will use the recommended
submodule.<name>.shallow
as provided by the.gitmodules
file by default. To ignore the suggestions use--no-recommend-shallow
.このオプションはupdateコマンドに対してのみ有効です。サブモジュールの初期クローンは、デフォルトでファイルによってsubmodule.<name>.shallow
提供された推奨を使用.gitmodules
します。提案を無視するにはを使用します--no-recommend-shallow
。 - -j <n>
- --jobs <n> - ジョブ<n>
-
This option is only valid for the update command. Clone new submodules in parallel with as many jobs. Defaults to the
submodule.fetchJobs
option.このオプションはupdateコマンドに対してのみ有効です。多くのジョブと並行して新しいサブモジュールを複製します。デフォルトはsubmodule.fetchJobs
オプションです。 - <path>… <パス>…
-
Paths to submodule(s). When specified this will restrict the command to only operate on the submodules found at the specified paths. (This argument is required with add).サブモジュールへのパス。これが指定されていると、指定されたパスにあるサブモジュールだけを操作するようにコマンドが制限されます。(この引数はaddと一緒に必要です)。
FILESファイル
When initializing submodules, a .gitmodules
file in the top-level directory
of the containing repository is used to find the url of each submodule.
This file should be formatted in the same way as $GIT_DIR/config
. The key
to each submodule url is "submodule.$name.url". See gitmodules[5]
for details.サブモジュールを初期化するときに.gitmodules
は、それを含むリポジトリの最上位ディレクトリにあるファイルを使用して、各サブモジュールのURLを見つけます。このファイルはと同じ方法でフォーマットする必要があります$GIT_DIR/config
。各サブモジュールのURLのキーは "submodule。$ name.url"です。詳細はgitmodules [5]を見てください。
SEE ALSO関連項目
gitsubmodules[7], gitmodules[5].gitsubmodules [7]、gitmodules [5]。
GIT
Part of the git[1] suite一部のgit [1]スイート
関連記事
- write-tree
- verify-pack
- update-ref
- update-index
- symbolic-ref
- show-ref
- rev-parse
- rev-list
- read-tree
- merge-base
- ls-files
- hash-object
- for-each-ref
- diff-index
- count-objects
- commit-tree
- checkout-index
- check-ignore
- cat-file
- bundle
- archive
- instaweb
- filter-branch
- reflog
- fsck
- gc
- clean
- Workflows
- Tutorial
- Revisions
- gitmodules
- gitignore
- githooks
- Glossary
- Everyday Git
- gitattributes
- update-server-info
- daemon
- fast-import
- svn
- request-pull
- send-email
- format-patch
- am
- grep
- blame
- bisect
- revert
- rebase
- cherry-pick
- apply
- describe
- shortlog
- show
- remote
- push
- pull
- fetch
- worktree
- tag
- stash
- log
- mergetool
- merge
- checkout
- branch
- mv
- rm
- reset
- commit
- diff
- status
- add
- clone
- init
- help
- config
- git
スポンサーリンク