bundle

NAME

git-bundle - Move objects and refs by archivegit-bundle - アーカイブによるオブジェクトと参照の移動

SYNOPSIS概要

git bundle create <file> <git-rev-list-args>
git bundle verify <file>
git bundle list-heads <file> [<refname>…​]
git bundle unbundle <file> [<refname>…​]

DESCRIPTION説明

Some workflows require that one or more branches of development on one machine be replicated on another machine, but the two machines cannot be directly connected, and therefore the interactive Git protocols (git, ssh, http) cannot be used. This command provides support for git fetch and git pull to operate by packaging objects and references in an archive at the originating machine, then importing those into another repository using git fetch and git pull after moving the archive by some means (e.g., by sneakernet). As no direct connection between the repositories exists, the user must specify a basis for the bundle that is held by the destination repository: the bundle assumes that all objects in the basis are already in the destination repository.ワークフローによっては、あるマシン上の1つ以上の開発ブランチを別のマシンに複製する必要がありますが、2つのマシンを直接接続することはできないため、対話式Gitプロトコル(git、ssh、http)を使用できません。このコマンドはサポートを提供gitのフェッチgitのプル使用して別のリポジトリにそれらをインポートした後、元のマシンでアーカイブ内のオブジェクトと参照をパッケージ化することによって動作するgitのフェッチgitのプル何らかの手段(例えば、sneakernet)によってアーカイブを移動した後。リポジトリ間の直接接続が存在しないため、ユーザは宛先リポジトリが保持しているバンドルの基本を指定する必要があります。バンドルは、基本内のすべてのオブジェクトがすでに宛先リポジトリにあると見なします。

OPTIONSオプション

create <file> <ファイル>を作成します。

Used to create a bundle named file. This requires the git-rev-list-args arguments to define the bundle contents.fileという名前のバンドルを作成するために使用されます。これには、バンドルの内容を定義するためのgit-rev-list-args引数が必要です。

verify <file> <file>を確認

Used to check that a bundle file is valid and will apply cleanly to the current repository. This includes checks on the bundle format itself as well as checking that the prerequisite commits exist and are fully linked in the current repository. git bundle prints a list of missing commits, if any, and exits with a non-zero status.バンドルファイルが有効で現在のリポジトリに正しく適用されることを確認するために使用されます。これには、バンドルフォーマット自体のチェック、および前提条件となるコミットが存在し、現在のリポジトリに完全にリンクされていることのチェックが含まれます。git bundleは、もしあれば、見つからないコミットのリストを表示し、ゼロ以外のステータスで終了します。

list-heads <file> リストヘッド<ファイル>

Lists the references defined in the bundle. If followed by a list of references, only references matching those given are printed out.バンドルに定義されている参照を一覧表示します。参照のリストが後に続く場合、与えられたものと一致する参照だけがプリントアウトされます。

unbundle <file> バンドル解除<file>

Passes the objects in the bundle to git index-pack for storage in the repository, then prints the names of all defined references. If a list of references is given, only references matching those in the list are printed. This command is really plumbing, intended to be called only by git fetch.バンドル内のオブジェクトをリポジトリに格納するためにindex-packgitするために渡してから、定義されているすべての参照の名前を出力します。参照のリストが指定されている場合は、リスト内の参照と一致する参照のみが印刷されます。このコマンドは実はplumbingであり、git fetchによってのみ呼び出されることを意図しています。

<git-rev-list-args>

A list of arguments, acceptable to git rev-parse and git rev-list (and containing a named ref, see SPECIFYING REFERENCES below), that specifies the specific objects and references to transport. For example, master~10..master causes the current master reference to be packaged along with all objects added since its 10th ancestor commit. There is no explicit limit to the number of references and objects that may be packaged.git rev-parsegit rev-listに受け入れ可能な引数のリスト(および名前付きのrefを含みます。下記の「参照の指定」を参照)。転送する特定のオブジェクトと参照を指定します。たとえばmaster~10..master、現在のマスター参照を、10回目の祖先コミット以降に追加されたすべてのオブジェクトとともにパッケージ化します。パッケージ化できる参照およびオブジェクトの数に明示的な制限はありません。

[<refname>…​] [<refname>…]

A list of references used to limit the references reported as available. This is principally of use to git fetch, which expects to receive only those references asked for and not necessarily everything in the pack (in this case, git bundle acts like git fetch-pack).利用可能として報告された参照を制限するために使用される参照のリスト。これは主にgit fetchに使用されます。これは、要求された参照のみを受け取り、必ずしもパック内のすべてを受け取るとは限らない(この場合、gitバンドルgit fetch-packのように動作します)。

SPECIFYING REFERENCES参照の指定

git bundle will only package references that are shown by git show-ref: this includes heads, tags, and remote heads. References such as master~1 cannot be packaged, but are perfectly suitable for defining the basis. More than one reference may be packaged, and more than one basis can be specified. The objects packaged are those not contained in the union of the given bases. Each basis can be specified explicitly (e.g. ^master~10), or implicitly (e.g. master~10..master, --since=10.days.ago master).gitバンドルgit show-refで表示される参照のみをパッケージ化します。これにはヘッド、タグ、リモートヘッドが含まれます。などの参照master~1はパッケージ化できませんが、基本を定義するのに最適です。複数の参照をパッケージ化することができ、複数の基準を指定できます。パッケージ化されたオブジェクトは、与えられたベースの和集合に含まれていないものです。各基礎は(例えば、明示的に指定することができます^master~10暗黙的に)、または(例えばmaster~10..master--since=10.days.ago master)。

It is very important that the basis used be held by the destination. It is okay to err on the side of caution, causing the bundle file to contain objects already in the destination, as these are ignored when unpacking at the destination.使用される基礎が目的地によって保持されることは非常に重要です。宛先で解凍すると無視されるため、バンドルファイルにすでに宛先にあるオブジェクトが含まれるようにするため、注意を怠っても構いません。

EXAMPLES

Assume you want to transfer the history from a repository R1 on machine A to another repository R2 on machine B. For whatever reason, direct connection between A and B is not allowed, but we can move data from A to B via some mechanism (CD, email, etc.). We want to update R2 with development made on the branch master in R1.マシンAのリポジトリR1からマシンBの別のリポジトリR2に履歴を転送するとします。何らかの理由で、AとBを直接接続することはできませんが、何らかのメカニズムを介してAからBにデータを移動できます。 、電子メールなど)。R2でブランチマスター上で行われた開発でR2を更新したいです。

To bootstrap the process, you can first create a bundle that does not have any basis. You can use a tag to remember up to what commit you last processed, in order to make it easy to later update the other repository with an incremental bundle:プロセスをブートストラップするには、まず根拠のないバンドルを作成します。タグを使用して、あとで増分バンドルを使用して他のリポジトリを簡単に更新できるように、最後に処理したコミットまでを覚えておくことができます。

machineA$ cd R1
machineA$ git bundle create file.bundle master
machineA$ git tag -f lastR2bundle master

Then you transfer file.bundle to the target machine B. Because this bundle does not require any existing object to be extracted, you can create a new repository on machine B by cloning from it:次に、file.bundleをターゲットマシンBに転送します。このバンドルでは既存のオブジェクトを抽出する必要がないため、クローンを作成してマシンBに新しいリポジトリを作成できます。

machineB$ git clone -b master /home/me/tmp/file.bundle R2

This will define a remote called "origin" in the resulting repository that lets you fetch and pull from the bundle. The $GIT_DIR/config file in R2 will have an entry like this:これにより、結果のリポジトリに「origin」と呼ばれるリモートを定義し、バンドルから取得してそこから取得することができます。R2の$ GIT_DIR / configファイルには、次のようなエントリがあります。

[remote "origin"]
    url = /home/me/tmp/file.bundle
    fetch = refs/heads/*:refs/remotes/origin/*

To update the resulting mine.git repository, you can fetch or pull after replacing the bundle stored at /home/me/tmp/file.bundle with incremental updates.生成されたmine.gitリポジトリを更新するには、/ home / me / tmp / file.bundleに格納されているバンドルを増分更新で置き換えた後に取得または取得できます。

After working some more in the original repository, you can create an incremental bundle to update the other repository:元のリポジトリでもう少し作業をした後、もう一方のリポジトリを更新するための増分バンドルを作成できます。

machineA$ cd R1
machineA$ git bundle create file.bundle lastR2bundle..master
machineA$ git tag -f lastR2bundle master

You then transfer the bundle to the other machine to replace /home/me/tmp/file.bundle, and pull from it.次に、そのバンドルを他のマシンに転送して/home/me/tmp/file.bundleを置き換え、そこから取り出します。

machineB$ cd R2
machineB$ git pull

If you know up to what commit the intended recipient repository should have the necessary objects, you can use that knowledge to specify the basis, giving a cut-off point to limit the revisions and objects that go in the resulting bundle. The previous example used the lastR2bundle tag for this purpose, but you can use any other options that you would give to the git-log[1] command. Here are more examples:意図した受信者リポジトリが必要なオブジェクトをどの程度までコミットしているかがわかっている場合は、その知識を使用して根拠を指定し、結果バンドルに含まれるリビジョンとオブジェクトを制限するカットオフポイントを指定できます。前の例ではこの目的のためにlastR2bundleタグを使用しましたが、git-log [1]コマンドに与える他のオプションを使用することができます。より多くの例はここにあります:

You can use a tag that is present in both:両方に存在するタグを使用できます。

$ git bundle create mybundle v1.0.0..master

You can use a basis based on time:時間に基づいて基準を使用することができます。

$ git bundle create mybundle --since=10.days master

You can use the number of commits:コミット数を使用できます。

$ git bundle create mybundle -10 master

You can run git-bundle verify to see if you can extract from a bundle that was created with a basis:git-bundle verify基底付きで作成されたバンドルから抽出できるかどうかを確認するために実行できます。

$ git bundle verify mybundle

This will list what commits you must have in order to extract from the bundle and will error out if you do not have them.これはバンドルから抽出するためにあなたが持っていなければならないコミットをリストし、あなたがそれらを持っていなければエラーになります。

A bundle from a recipient repository’s point of view is just like a regular repository which it fetches or pulls from. You can, for example, map references when fetching:受信側リポジトリの観点からのバンドルは、取得または取得元の通常のリポジトリとまったく同じです。たとえば、取得時に参照をマップできます。

$ git fetch mybundle master:localRef

You can also see what references it offers:また、それが提供している参照も確認できます。

$ git ls-remote mybundle

GIT

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

関連記事

スポンサーリンク

文字列テンプレート

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

上に戻る