push

NAME

git-push - Update remote refs along with associated objectsgit-push - 関連付けられたオブジェクトとともにリモート参照を更新する

SYNOPSIS概要

git push [--all | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
	   [--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-v | --verbose]
	   [-u | --set-upstream] [-o <string> | --push-option=<string>]
	   [--[no-]signed|--signed=(true|false|if-asked)]
	   [--force-with-lease[=<refname>[:<expect>]]]
	   [--no-verify] [<repository> [<refspec>…​]]

DESCRIPTION説明

Updates remote refs using local refs, while sending objects necessary to complete the given refs.指定された参照を完了するのに必要なオブジェクトを送信しながら、ローカル参照を使用してリモート参照を更新します。

You can make interesting things happen to a repository every time you push into it, by setting up hooks there. See documentation for git-receive-pack[1].そこにフックを設定することで、リポジトリにプッシュするたびに面白いことを起こすことができます。git-receive-pack [1]のドキュメントを参照してください。

When the command line does not specify where to push with the <repository> argument, branch.*.remote configuration for the current branch is consulted to determine where to push. If the configuration is missing, it defaults to origin.コマンドラインで<repository>引数でプッシュする場所を指定していない場合はbranch.*.remote、現在のブランチの設定を調べてプッシュする場所を決定します。設定が欠けている場合、デフォルトはoriginになります。

When the command line does not specify what to push with <refspec>... arguments or --all, --mirror, --tags options, the command finds the default <refspec> by consulting remote.*.push configuration, and if it is not found, honors push.default configuration to decide what to push (See git-config[1] for the meaning of push.default).コマンドラインがでプッシュするかを指定しない場合は<refspec>...、引数または--all--mirror--tagsオプション、コマンドは、デフォルトを見つけた<refspec>コンサルティングにより、remote.*.pushコンフィギュレーションを、そしてそれが見つからない場合は、優等push.defaultプッシュするかを決定するための構成は、(参照のgit-config設定を[1]についての意味push.default)。

When neither the command-line nor the configuration specify what to push, the default behavior is used, which corresponds to the simple value for push.default: the current branch is pushed to the corresponding upstream branch, but as a safety measure, the push is aborted if the upstream branch does not have the same name as the local one.コマンドラインも設定もプッシュするものを指定していない場合、デフォルトの振る舞いが使用されます。これは、次のsimple値に対応しますpush.default。現在のブランチは対応するアップストリームブランチにプッシュされます。上流のブランチはローカルのものと同じ名前を持っていません。

OPTIONSオプション

<repository> <リポジトリ>

The "remote" repository that is destination of a push operation. This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below).プッシュ操作の宛先である「リモート」リポジトリ。このパラメータは、URL(後述のGIT URLを参照)またはリモートの名前(下記のREMOTESを参照)のいずれかになります。

<refspec>…​ <reffspec>…

Specify what destination ref to update with what source object. The format of a <refspec> parameter is an optional plus +, followed by the source object <src>, followed by a colon :, followed by the destination ref <dst>.どのソースオブジェクトで更新するのかを指定します。<reffspec>パラメータのフォーマットは、オプションのプラス+、その後にソースオブジェクト<src>、コロン:、それに続くデスティネーションref <dst>が続きます。

The <src> is often the name of the branch you would want to push, but it can be any arbitrary "SHA-1 expression", such as master~4 or HEAD (see gitrevisions[7]).<src>はプッシュしたいブランチの名前ですが、master~4or などの任意の "SHA-1式" でもかまいませんHEADgitrevisions [7]を参照)。

The <dst> tells which ref on the remote side is updated with this push. Arbitrary expressions cannot be used here, an actual ref must be named. If git push [<repository>] without any <refspec> argument is set to update some ref at the destination with <src> with remote.<repository>.push configuration variable, :<dst> part can be omitted—​such a push will update a ref that <src> normally updates without any <refspec> on the command line. Otherwise, missing :<dst> means to update the same ref as the <src>.<dst>は、このプッシュでリモート側のどの参照が更新されるかを示します。ここでは任意の式を使用することはできません。実際の参照名を指定する必要があります。場合git push [<repository>]任意なし<refspec>引数を用いて先にいくつかの参考文献を更新するように設定されている<src>とともにremote.<repository>.push、構成変数、:<dst>部分はomitted-可能なプッシュは、REF更新され<src>、通常、任意のせずに更新する<refspec>コマンドラインです。そうでなければ、欠けている:<dst>ということは、と同じ参照を更新するということ<src>です。

If <dst> doesn’t start with refs/ (e.g. refs/heads/master) we will try to infer where in refs/* on the destination <repository> it belongs based on the the type of <src> being pushed and whether <dst> is ambiguous.<dst>で始まらない場合refs/(例えばrefs/heads/masterrefs/*、プッシュされる<src>のタイプと<dst>があいまいかどうかに基づいて、宛先<repository>上のどこにあるのかを推測しようとします。

  • If <dst> unambiguously refers to a ref on the <repository> remote, then push to that ref.<dst>が<repository>リモートの参照を明確に参照している場合は、その参照をプッシュしてください。

  • If <src> resolves to a ref starting with refs/heads/ or refs/tags/, then prepend that to <dst>.<src>がrefs / heads /またはrefs / tags /で始まるrefに解決される場合は、その前に<dst>を付けます。

  • Other ambiguity resolutions might be added in the future, but for now any other cases will error out with an error indicating what we tried, and depending on the advice.pushUnqualifiedRefname configuration (see git-config[1]) suggest what refs/ namespace you may have wanted to push to.その他のあいまいさの解像度は、将来追加されるかもしれないが、今のところ、他の例では、我々がしようとしたものを示すエラーと出てエラーになります、とに応じてadvice.pushUnqualifiedRefname設定(参照のgit-config設定を[1] )あなたが思っているかもしれないものレフリー/名前空間の提案にプッシュする。

The object referenced by <src> is used to update the <dst> reference on the remote side. Whether this is allowed depends on where in refs/* the <dst> reference lives as described in detail below, in those sections "update" means any modifications except deletes, which as noted after the next few sections are treated differently.<src>によって参照されるオブジェクトは、リモート側の<dst>参照を更新するために使用されます。これが許されるかどうかはrefs/*、以下で詳細に説明されるように<dst>参照のどこに存在するかに依存します、それらのセクションの "update"は削除以外の変更を意味します。

The refs/heads/* namespace will only accept commit objects, and updates only if they can be fast-forwarded.refs/heads/*名前空間には、オブジェクトのみをコミット受け入れ、彼らは早送りすることができた場合にのみ更新されます。

The refs/tags/* namespace will accept any kind of object (as commits, trees and blobs can be tagged), and any updates to them will be rejected.refs/tags/*名前空間は(コミットとして、木々や塊をタグ付けすることができます)任意の種類のオブジェクトを受け入れますし、それらへの更新は拒否されます。

It’s possible to push any type of object to any namespace outside of refs/{tags,heads}/*. In the case of tags and commits, these will be treated as if they were the commits inside refs/heads/* for the purposes of whether the update is allowed.どんな種類のオブジェクトでも外部の名前空間にプッシュすることは可能ですrefs/{tags,heads}/*。タグとコミットの場合はrefs/heads/*、更新が許可されているかどうかを判断するために、それらが内部のコミットであるかのように扱われます。

I.e. a fast-forward of commits and tags outside refs/{tags,heads}/* is allowed, even in cases where what’s being fast-forwarded is not a commit, but a tag object which happens to point to a new commit which is a fast-forward of the commit the last tag (or commit) it’s replacing. Replacing a tag with an entirely different tag is also allowed, if it points to the same commit, as well as pushing a peeled tag, i.e. pushing the commit that existing tag object points to, or a new tag object which an existing commit points to.refs/{tags,heads}/*つまり、早送りされているものがコミットではなく、最後のコミットの早送りである新しいコミットを指すタグオブジェクトである場合でも、コミットとタグの早送りは許可されます。それが置き換えているタグ(またはコミット)。同じコミットを指している場合や、既存のタグオブジェクトが指しているコミット、または既存のコミットが指している新しいタグオブジェクトをプッシュしている場合と同様に、まったく異なるタグでタグを置き換えることもできます。 。

Tree and blob objects outside of refs/{tags,heads}/* will be treated the same way as if they were inside refs/tags/*, any update of them will be rejected.外側のツリーとBLOBオブジェクトrefs/{tags,heads}/*は内側refs/tags/*にある場合と同じように扱われ、それらの更新は拒否されます。

All of the rules described above about what’s not allowed as an update can be overridden by adding an the optional leading + to a refspec (or using --force command line option). The only exception to this is that no amount of forcing will make the refs/heads/* namespace accept a non-commit object. Hooks and configuration can also override or amend these rules, see e.g. receive.denyNonFastForwards in git-config[1] and pre-receive and update in githooks[5].更新として許可されていないことに関する上記のすべての規則は+、refspecへのオプションの先頭の追加(または--forceコマンドラインオプションの使用)によって上書きすることができます。これに対する唯一の例外は、refs/heads/*名前空間がコミットされていないオブジェクトを受け入れるように強制しないことです。フックおよび構成はまた、例えば参照、オーバーライドまたはこれらのルールを修正することができるreceive.denyNonFastForwardsはgit-設定[1]pre-receiveし、updategithooks [5]

Pushing an empty <src> allows you to delete the <dst> ref from the remote repository. Deletions are always accepted without a leading + in the refspec (or --force), except when forbidden by configuration or hooks. See receive.denyDeletes in git-config[1] and pre-receive and update in githooks[5].空の<src>を押すと、リモートリポジトリから<dst> refを削除できます。設定やフックによって禁止されている場合を除いて、削除は常に+refspec(または--force)の先頭に来ることなく受け入れられます。参照receive.denyDeletesのgit -設定[1]pre-receiveし、updategithooks [5]

The special refspec : (or +: to allow non-fast-forward updates) directs Git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name already exists on the remote side.特別なrefspec :(または+:早送りではない更新を許可する)は、Gitに "一致する"ブランチをプッシュするよう指示します。ローカル側に存在するすべてのブランチについて、同じ名前のブランチがすでにリモートに存在する場合はリモート側が更新されます。側。

tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>.tag <tag>と同じ意味refs/tags/<tag>:refs/tags/<tag>です。

--all - すべて

Push all branches (i.e. refs under refs/heads/); cannot be used with other <refspec>.すべてのブランチをプッシュします(つまり、下にrefs/heads/参照)。他の<refspec>と一緒に使用することはできません。

--prune - プルーン

Remove remote branches that don’t have a local counterpart. For example a remote branch tmp will be removed if a local branch with the same name doesn’t exist any more. This also respects refspecs, e.g. git push --prune remote refs/heads/*:refs/tmp/* would make sure that remote refs/tmp/foo will be removed if refs/heads/foo doesn’t exist.ローカルに対応するものがないリモートブランチを削除します。たとえばtmp、同じ名前のローカルブランチがもう存在しない場合、リモートブランチは削除されます。これはまた、refspecを尊重します。たとえば、存在しない場合はgit push --prune remote refs/heads/*:refs/tmp/*remote refs/tmp/fooが削除されるようにrefs/heads/fooします。

--mirror - 鏡

Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote.<remote>.mirror is set.代わりにプッシュする各REFを命名の、下にあるすべての参考文献ことを指定するrefs/(しかし含んに限定されるものではなくrefs/heads/refs/remotes/およびrefs/tags/リモートリポジトリにミラーリングすること)。新しく作成されたローカル参照はリモートエンドにプッシュされ、ローカルに更新された参照はリモートエンドで強制的に更新され、削除された参照はリモートエンドから削除されます。構成オプションremote.<remote>.mirrorが設定されている場合、これがデフォルトです。

-n
--dry-run

Do everything except actually send the updates.実際に更新を送信する以外のすべてを行います。

--porcelain - 磁器

Produce machine-readable output. The output status line for each ref will be tab-separated and sent to stdout instead of stderr. The full symbolic names of the refs will be given.機械可読な出力を生成します。各参照の出力ステータス行はタブで区切られ、stderrではなくstdoutに送信されます。参照の完全なシンボル名が与えられます。

-d
--delete - 削除

All listed refs are deleted from the remote repository. This is the same as prefixing all refs with a colon.リストされているすべての参照はリモートリポジトリから削除されます。これは、すべての参照の前にコロンを付けるのと同じです。

--tags - タグ

All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line.refs/tags明示的にコマンドラインにリストされている参照仕様に加えて、下のすべての参照がプッシュされます。

--follow-tags - フォロータグ

Push all the refs that would be pushed without this option, and also push annotated tags in refs/tags that are missing from the remote but are pointing at commit-ish that are reachable from the refs being pushed. This can also be specified with configuration variable push.followTags. For more information, see push.followTags in git-config[1].このオプションなしでプッシュされるであろうすべての参照をプッシュし、さらにrefs/tagsその中のリモートから欠けているがプッシュされている参照から到達可能なcommit-ishを指している注釈付きタグをプッシュします。これは設定変数でも指定できますpush.followTags。詳しくpush.followTagsgit-config [1]をご覧ください。

--[no-]signed - [no-]署名しました
--signed=(true|false|if-asked) --signed =(true | false | if-ask)

GPG-sign the push request to update refs on the receiving side, to allow it to be checked by the hooks and/or be logged. If false or --no-signed, no signing will be attempted. If true or --signed, the push will fail if the server does not support signed pushes. If set to if-asked, sign if and only if the server supports signed pushes. The push will also fail if the actual call to gpg --sign fails. See git-receive-pack[1] for the details on the receiving end.プッシュリクエストにGPG署名して、受信側で参照を更新し、フックでチェックしたりログに記録したりできるようにします。falseまたはの場合--no-signed、署名は試行されません。場合true--signed、サーバーが署名したプッシュをサポートしていない場合、プッシュは失敗します。に設定するif-askedと、サーバーが署名付きプッシュをサポートしている場合に限り署名します。実際の呼び出しがgpg --sign失敗した場合もプッシュは失敗します。受信側の詳細についてはgit-receive-pack [1]を見てください。

--[no-]atomic - [no-] atomic

Use an atomic transaction on the remote side if available. Either all refs are updated, or on error, no refs are updated. If the server does not support atomic pushes the push will fail.可能であれば、リモート側でアトミックトランザクションを使用してください。すべての参照が更新されるか、エラーが発生した場合は参照が更新されません。サーバーがアトミックプッシュをサポートしていない場合、プッシュは失敗します。

-o <option> -o <オプション>
--push-option=<option> --push-option = <オプション>

Transmit the given string to the server, which passes them to the pre-receive as well as the post-receive hook. The given string must not contain a NUL or LF character. When multiple --push-option=<option> are given, they are all sent to the other side in the order listed on the command line. When no --push-option=<option> is given from the command line, the values of configuration variable push.pushOption are used instead.与えられた文字列をサーバに送信します。サーバはそれらを受信前フックと受信後フックに渡します。与えられた文字列はNULやLF文字を含んではいけません。複数指定されて--push-option=<option>いる場合、それらはすべてコマンドラインにリストされた順序で反対側に送信されます。--push-option=<option>コマンドラインからno が与えられると、push.pushOption代わりに設定変数の値が使用されます。

--receive-pack=<git-receive-pack> --receive-pack = <git-receive-pack>
--exec=<git-receive-pack> --exec = <git-receive-pack>

Path to the git-receive-pack program on the remote end. Sometimes useful when pushing to a remote repository over ssh, and you do not have the program in a directory on the default $PATH.リモートエンドのgit-receive-packプログラムへのパス。sshを使ってリモートリポジトリにプッシュするときに便利で、デフォルトの$ PATHのディレクトリにプログラムがない場合があります。

--[no-]force-with-lease - [no-]リース強制
--force-with-lease=<refname> --force-with-lease = <refname>
--force-with-lease=<refname>:<expect> --force-with-lease = <refname>:<expect>

Usually, "git push" refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it.通常、 "git push"はそれを上書きするために使われたローカルのrefの先祖ではないリモートのrefを更新することを拒否します。

This option overrides this restriction if the current value of the remote ref is the expected value. "git push" fails otherwise.このオプションは、リモート参照の現在の値が期待値である場合に、この制限を無効にします。そうでなければ "git push"は失敗します。

Imagine that you have to rebase what you have already published. You will have to bypass the "must fast-forward" rule in order to replace the history you originally published with the rebased history. If somebody else built on top of your original history while you are rebasing, the tip of the branch at the remote may advance with her commit, and blindly pushing with --force will lose her work.あなたがすでに公開したものをリベースする必要があると想像してください。最初に公開した履歴をリベースした履歴に置き換えるには、「早送りが必要」ルールをバイパスする必要があります。あなたがリベースしている間に他の誰かがあなたの元の履歴の上に構築した場合、リモートのブランチの先端は彼女のコミットで進み、盲目的に押すと--force彼女の仕事を失うでしょう。

This option allows you to say that you expect the history you are updating is what you rebased and want to replace. If the remote ref still points at the commit you specified, you can be sure that no other people did anything to the ref. It is like taking a "lease" on the ref without explicitly locking it, and the remote ref is updated only if the "lease" is still valid.このオプションは、あなたが更新している履歴があなたがリベースしたものであり、置き換えたいものであることを期待していると言うことを可能にします。それでもリモートの参照が指定したコミットを指している場合は、他の人がその参照に対して何もしなかったことを確認できます。それは明示的にそれをロックせずにrefの "リース"を取るようなものです、そして "リース"がまだ有効である場合にのみリモートのrefが更新されます。

--force-with-lease alone, without specifying the details, will protect all remote refs that are going to be updated by requiring their current value to be the same as the remote-tracking branch we have for them.--force-with-lease 詳細を指定せずに単独で、それらの現在の値が我々がそれらのために持っているリモート追跡ブランチと同じであることを要求することによって更新されることになっているすべてのリモート参照を保護します。

--force-with-lease=<refname>, without specifying the expected value, will protect the named ref (alone), if it is going to be updated, by requiring its current value to be the same as the remote-tracking branch we have for it.--force-with-lease=<refname>、期待値を指定せずに、それが更新されることになっているなら、その現在の値が我々がそれのために持っている遠隔追跡ブランチと同じであることを要求することによって名前付きrefを(単独で)保護するでしょう。

--force-with-lease=<refname>:<expect> will protect the named ref (alone), if it is going to be updated, by requiring its current value to be the same as the specified value <expect> (which is allowed to be different from the remote-tracking branch we have for the refname, or we do not even have to have such a remote-tracking branch when this form is used). If <expect> is the empty string, then the named ref must not already exist.--force-with-lease=<refname>:<expect>それが更新されようとしているなら、指定された値と同じであることを要求することによって名前付きのrefを(単独で)保護するでしょう<expect>(それはrefnameのために持っている遠隔追跡ブランチと異なることが許されます)。このフォームが使用されている場合は、このようなリモートトラッキングブランチも必要ありません。<expect>が空の文字列の場合、名前付きのrefはまだ存在してはいけません。

Note that all forms other than --force-with-lease=<refname>:<expect> that specifies the expected current value of the ref explicitly are still experimental and their semantics may change as we gain experience with this feature.それ以外のすべての形式--force-with-lease=<refname>:<expect>は明示的にrefの期待される現在の値を明示的に指定したものであり、まだ実験的なものであり、それらの意味はこの機能で経験を積むにつれて変わるかもしれません。

"--no-force-with-lease" will cancel all the previous --force-with-lease on the command line."--no-force-with-lease"は、コマンドライン上の前の--force-with-leaseをすべてキャンセルします。

A general note on safety: supplying this option without an expected value, i.e. as --force-with-lease or --force-with-lease=<refname> interacts very badly with anything that implicitly runs git fetch on the remote to be pushed to in the background, e.g. git fetch origin on your repository in a cronjob.安全性に関する一般的な注意:このオプションを期待値なしで提供する、つまり暗黙のうちにリモートで実行されてバックグラウンドでプッシュされるもの、たとえばcronjob内のリポジトリ--force-with-leaseなどと--force-with-lease=<refname>相互作用する。git fetchgit fetch origin

The protection it offers over --force is ensuring that subsequent changes your work wasn’t based on aren’t clobbered, but this is trivially defeated if some background process is updating refs in the background. We don’t have anything except the remote tracking info to go by as a heuristic for refs you’re expected to have seen & are willing to clobber.それが提供する保護--forceはあなたの作品が基づいていなかったその後の変更が邪魔されないことを確実にすることですが、バックグラウンドプロセスがバックグラウンドで参照を更新しているならばこれは自明に敗北します。私たちはあなたが見たことがあると期待していてclobberをして??も構わないと思っている参照のための発見的方法として通るべき遠隔追跡情報以外に何も持っていません。

If your editor or some other system is running git fetch in the background for you a way to mitigate this is to simply set up another remote:あなたのエディタや他のシステムがgit fetchあなたのためにバックグラウンドで実行されているなら、これを軽減する方法は単に別のリモートを設定することです:

git remote add origin-push $(git config remote.origin.url)
git fetch origin-push

Now when the background process runs git fetch origin the references on origin-push won’t be updated, and thus commands like:これで、バックグラウンドプロセスが実行されたgit fetch originときに参照origin-pushが更新されず、コマンドが次のようになります。

git push --force-with-lease origin-push

Will fail unless you manually run git fetch origin-push. This method is of course entirely defeated by something that runs git fetch --all, in that case you’d need to either disable it or do something more tedious like:手動で実行しない限り失敗しますgit fetch origin-push。このメソッドはもちろん実行されるものによって完全にgit fetch --all無効にされます、その場合あなたはそれを無効にするか、あるいはもっと退屈なことをする必要があるでしょう:

git fetch              # update 'master' from remote
git tag base master    # mark our base point
git rebase -i master   # rewrite some commits
git push --force-with-lease=master:base master:master

I.e. create a base tag for versions of the upstream code that you’ve seen and are willing to overwrite, then rewrite history, and finally force push changes to master if the remote version is still at base, regardless of what your local remotes/origin/master has been updated to in the background.つまりは、作成baseあなたが見てきた上流のコードのバージョンのためのタグをしてから、上書き歴史を書き換え、そして最後にプッシュの変更を強制して喜んでいるmasterリモートバージョンがのままである場合baseにかかわらず、あなたの地元は何の、remotes/origin/master中に更新されましたバックグラウンド。

-f
--force - 力

Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it. Also, when --force-with-lease option is used, the command refuses to update a remote ref whose current value does not match what is expected.通常、このコマンドは、上書きに使用されたローカル参照の先祖ではないリモート参照の更新を拒否します。また、--force-with-leaseoptionが使用されている場合、コマンドは現在の値が予想されたものと一致しないリモート参照の更新を拒否します。

This flag disables these checks, and can cause the remote repository to lose commits; use it with care.このフラグはこれらのチェックを無効にし、リモートリポジトリがコミットを失う原因になります。慎重に使用してください。

Note that --force applies to all the refs that are pushed, hence using it with push.default set to matching or with multiple push destinations configured with remote.*.push may overwrite refs other than the current branch (including local refs that are strictly behind their remote counterpart). To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the <refspec>... section above for details.--force故にでそれを使用して、プッシュされたすべての参考文献に適用push.defaultするように設定matchingまたはで構成された複数のプッシュ先とremote.*.push(その遠隔相手の背後に厳密であるローカル参考文献を含む)は、現在のブランチ以外の参考文献を上書きしてもよいです。強制的に1つのブランチにプッシュするに+は、refspecの前にあるを押してプッシュします(たとえばgit push origin +mastermasterブランチにプッシュするよう強制する)。詳細は<refspec>...上記のセクションを参照してください。

--repo=<repository> --repo = <リポジトリ>

This option is equivalent to the <repository> argument. If both are specified, the command-line argument takes precedence.このオプションは<repository>引数と同等です。両方を指定した場合は、コマンドライン引数が優先されます。

-u
--set-upstream

For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull[1] and other commands. For more information, see branch.<name>.merge in git-config[1].最新のブランチ、または正常にプッシュされたすべてのブランチに対して、引数のないgit-pull [1]などのコマンドで使用されるアップストリーム(トラッキング)参照を追加します。詳しくbranch.<name>.mergegit-config [1]をご覧ください。

--[no-]thin - [no-] thin

These options are passed to git-send-pack[1]. A thin transfer significantly reduces the amount of sent data when the sender and receiver share many of the same objects in common. The default is --thin.これらのオプションはgit-send-pack [1]に渡されます。シン転送は、送信側と受信側が同じオブジェクトを多数共有している場合に送信データ量を大幅に削減します。デフォルトは--thinです。

-q
--quiet - 静か

Suppress all output, including the listing of updated refs, unless an error occurs. Progress is not reported to the standard error stream.エラーが発生しない限り、更新された参照のリストを含むすべての出力を抑制します。進行状況は標準エラーストリームに報告されません。

-v
--verbose - 冗談

Run verbosely.冗長に実行します。

--progress - 進捗

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が指定されていない限り、進行状況は端末に接続されたときにデフォルトで標準エラー・ストリームに報告されます。このフラグは、標準エラーストリームが端末に向けられていなくても進行状況を強制します。

--no-recurse-submodules
--recurse-submodules=check|on-demand|only|no --recurse-submodules = check | on-demand | only | no

May be used to make sure all submodule commits used by the revisions to be pushed are available on a remote-tracking branch. If check is used Git will verify that all submodule commits that changed in the revisions to be pushed are available on at least one remote of the submodule. If any commits are missing the push will be aborted and exit with non-zero status. If on-demand is used all submodules that changed in the revisions to be pushed will be pushed. If on-demand was not able to push all necessary revisions it will also be aborted and exit with non-zero status. If only is used all submodules will be recursively pushed while the superproject is left unpushed. A value of no or using --no-recurse-submodules can be used to override the push.recurseSubmodules configuration variable when no submodule recursion is required.リビジョンによってプッシュされるすべてのサブモジュールコミットがリモートトラッキングブランチで利用可能であることを確認するために使用されるかもしれません。checkが使用されている場合、Gitはプッシュされるリビジョンで変更されたすべてのサブモジュールコミットがサブモジュールの少なくとも1つのリモートで利用可能であることを確認します。何らかのコミットが欠けている場合、プッシュは中止され、ゼロ以外のステータスで終了します。オンデマンドが使用されている場合、リビジョンでプッシュされるように変更されたすべてのサブモジュールがプッシュされます。オンデマンドで必要なすべてのリビジョンをプッシュすることができなかった場合も、中止され、ゼロ以外のステータスで終了します。これだけを使用すると、スーパープロジェクトはプッシュされないまま、すべてのサブモジュールが再帰的にプッシュされます。noまたはusingの値--no-recurse-submodules サブモジュールの再帰が必要ない場合は、push.recurseSubmodules構成変数をオーバーライドするために使用できます。

--[no-]verify - [no-]確認

Toggle the pre-push hook (see githooks[5]). The default is --verify, giving the hook a chance to prevent the push. With --no-verify, the hook is bypassed completely.プリプッシュフックを切り替えます(githooks [5]を参照)。デフォルトは--verifyで、フックにプッシュを防ぐ機会を与えます。--no-verifyを使用すると、フックは完全に回避されます。

-4
--ipv4

Use IPv4 addresses only, ignoring IPv6 addresses.IPv6アドレスを無視して、IPv4アドレスのみを使用してください。

-6
--ipv6

Use IPv6 addresses only, ignoring IPv4 addresses.IPv4アドレスを無視して、IPv6アドレスのみを使用してください。

GIT URLSGIT URL

In general, URLs contain information about the transport protocol, the address of the remote server, and the path to the repository. Depending on the transport protocol, some of this information may be absent.一般に、URLにはトランスポートプロトコル、リモートサーバーのアドレス、およびリポジトリへのパスに関する情報が含まれています。トランスポートプロトコルによっては、この情報の一部が欠落している可能性があります。

Git supports ssh, git, http, and https protocols (in addition, ftp, and ftps can be used for fetching, but this is inefficient and deprecated; do not use it).Gitはssh、git、http、およびhttpsプロトコルをサポートしています(さらに、ftp、およびftpsをフェッチに使用できますが、これは非効率的で非推奨です。使用しないでください)。

The native transport (i.e. git:// URL) does no authentication and should be used with caution on unsecured networks.ネイティブトランスポート(つまりgit:// URL)は認証を行わないため、セキュリティ保護されていないネットワークでは注意して使用する必要があります。

The following syntaxes may be used with them:以下の構文がそれらと共に使用されるかもしれません:

  • ssh://[user@]host.xz[:port]/path/to/repo.git/ssh:// [user @] host.xz [:port] /path/to/repo.git/

  • git://host.xz[:port]/path/to/repo.git/git://host.xz [:port] /path/to/repo.git/

  • http[s]://host.xz[:port]/path/to/repo.git/http [s]://host.xz [:port] /path/to/repo.git/

  • ftp[s]://host.xz[:port]/path/to/repo.git/ftp [s]://host.xz [:port] /path/to/repo.git/

An alternative scp-like syntax may also be used with the ssh protocol:sshプロトコルでは、scpに似た代替構文も使用できます。

  • [user@]host.xz:path/to/repo.git/[user @] host.xz:パス/ to / repo.git /

This syntax is only recognized if there are no slashes before the first colon. This helps differentiate a local path that contains a colon. For example the local path foo:bar could be specified as an absolute path or ./foo:bar to avoid being misinterpreted as an ssh url.この構文は、最初のコロンの前にスラッシュがない場合にのみ認識されます。これは、コロンを含むローカルパスを区別するのに役立ちます。たとえば、ローカルパスをfoo:bar絶対パスとして指定したり./foo:bar、sshのURLとして誤って解釈されないようにすることができます。

The ssh and git protocols additionally support ~username expansion:sshおよびgitプロトコルはさらに〜ユーザー名の展開をサポートします。

  • ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/ssh:// [ユーザー@] host.xz [:ポート] /〜[ユーザー] /path/to/repo.git/

  • git://host.xz[:port]/~[user]/path/to/repo.git/git://host.xz [:port] /〜[ユーザー] /path/to/repo.git/

  • [user@]host.xz:/~[user]/path/to/repo.git/[user @] host.xz:/〜[user] /path/to/repo.git/

For local repositories, also supported by Git natively, the following syntaxes may be used:同じくGitによってサポートされているローカルリポジトリのために、以下の構文が使用されるかもしれません:

  • /path/to/repo.git/

  • file:///path/to/repo.git/file:///path/to/repo.git/

These two syntaxes are mostly equivalent, except when cloning, when the former implies --local option. See git-clone[1] for details.これら2つの構文は、前者が--localオプションを暗黙指定している場合を除いて、クローン作成時を除いてほぼ同等です。詳細はgit-clone [1]をご覧ください。

When Git doesn’t know how to handle a certain transport protocol, it attempts to use the remote-<transport> remote helper, if one exists. To explicitly request a remote helper, the following syntax may be used:Gitが特定のトランスポートプロトコルの扱い方を知らない場合、remote- <transport>リモートヘルパーがあればそれを使用しようとします。リモートヘルパーを明示的に要求するには、次の構文が使用されます。

  • <transport>::<address><トランスポート> :: <アドレス>

where <address> may be a path, a server and path, or an arbitrary URL-like string recognized by the specific remote helper being invoked. See gitremote-helpers[1] for details.ここで、<address>はパス、サーバーとパス、または呼び出されている特定のリモートヘルパーによって認識される任意のURLのような文字列です。詳細はgitremote-helpers [1]を見てください。

If there are a large number of similarly-named remote repositories and you want to use a different format for them (such that the URLs you use will be rewritten into URLs that work), you can create a configuration section of the form:同じ名前のリモートリポジトリが多数あり、それらに異なるフォーマットを使用する場合(使用するURLが機能するURLに書き換えられるなど)は、次の形式の構成セクションを作成できます。

	[url "<actual url base>"]
		insteadOf = <other url base>

For example, with this:たとえば、これで:

	[url "git://git.host.xz/"]
		insteadOf = host.xz:/path/to/
		insteadOf = work:

a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be rewritten in any context that takes a URL to be "git://git.host.xz/repo.git"."work:repo.git"や "host.xz:/path/to/repo.git"のようなURLは、URLが "git://git.host.xz/repo"になるような任意のコンテキストで書き換えられます。 "git"。

If you want to rewrite URLs for push only, you can create a configuration section of the form:プッシュ専用のURLに書き換えたい場合は、次の形式の構成セクションを作成できます。

	[url "<actual url base>"]
		pushInsteadOf = <other url base>

For example, with this:たとえば、これで:

	[url "ssh://example.org/"]
		pushInsteadOf = git://example.org/

a URL like "git://example.org/path/to/repo.git" will be rewritten to "ssh://example.org/path/to/repo.git" for pushes, but pulls will still use the original URL."git://example.org/path/to/repo.git"のようなURLはプッシュのために "ssh://example.org/path/to/repo.git"に書き換えられますが、プルは依然として元のURL

REMOTESリモート

The name of one of the following can be used instead of a URL as <repository> argument:<repository>引数としてURLの代わりに次のいずれかの名前を使用できます。

  • a remote in the Git configuration file: $GIT_DIR/config,Gitの設定ファイルのリモート:$GIT_DIR/config

  • a file in the $GIT_DIR/remotes directory, or$GIT_DIR/remotesディレクトリ内のファイル

  • a file in the $GIT_DIR/branches directory.$GIT_DIR/branchesディレクトリ内のファイル

All of these also allow you to omit the refspec from the command line because they each contain a refspec which git will use by default.これらはすべてgitがデフォルトで使用するrefspecを含んでいるので、コマンドラインからrefspecを省略することもできます。

Named remote in configuration file構成ファイルで名前付きリモート

You can choose to provide the name of a remote which you had previously configured using git-remote[1], git-config[1] or even by a manual edit to the $GIT_DIR/config file. The URL of this remote will be used to access the repository. The refspec of this remote will be used by default when you do not provide a refspec on the command line. The entry in the config file would appear like this:あなたは以前にgit-remote [1]git-config [1]を使って、あるいは手動編集によって、あなたが以前に設定したリモートの名前を提供することを選ぶことができます$GIT_DIR/config。このリモートのURLはリポジトリへのアクセスに使用されます。コマンドラインでrefspecを指定しないと、このリモートのrefspecがデフォルトで使用されます。設定ファイルのエントリは次のようになります。

	[remote "<name>"]
		url = <url>
		pushurl = <pushurl>
		push = <refspec>
		fetch = <refspec>

The <pushurl> is used for pushes only. It is optional and defaults to <url>.<pushurl>だけプッシュするために使用されています。これはオプションであり、デフォルトはです<url>

Named file in $GIT_DIR/remotes名前付きファイル $GIT_DIR/remotes

You can choose to provide the name of a file in $GIT_DIR/remotes. The URL in this file will be used to access the repository. The refspec in this file will be used as default when you do not provide a refspec on the command line. This file should have the following format:でファイルの名前を提供することを選択できます$GIT_DIR/remotes。このファイルのURLはリポジトリへのアクセスに使用されます。コマンドラインでrefspecを指定しないと、このファイルのrefspecがデフォルトとして使用されます。このファイルの形式は次のとおりです。

	URL: one of the above URL format
	Push: <refspec>
	Pull: <refspec>

Push: lines are used by git push and Pull: lines are used by git pull and git fetch. Multiple Push: and Pull: lines may be specified for additional branch mappings.Push:linesはgit pushによって使われ、Pull:linesはgit pullgit fetchによって使われます。追加のブランチマッピングには、複数行Push:Pull:行を指定できます。

Named file in $GIT_DIR/branches名前付きファイル $GIT_DIR/branches

You can choose to provide the name of a file in $GIT_DIR/branches. The URL in this file will be used to access the repository. This file should have the following format:でファイルの名前を提供することを選択できます$GIT_DIR/branches。このファイルのURLはリポジトリへのアクセスに使用されます。このファイルの形式は次のとおりです。

	<url>#<head>

<url> is required; #<head> is optional.<url>必要とされている; #<head>オプションです。

Depending on the operation, git will use one of the following refspecs, if you don’t provide one on the command line. <branch> is the name of this file in $GIT_DIR/branches and <head> defaults to master.操作に応じて、コマンドラインで指定しない場合、gitは以下のいずれかの参照仕様を使用します。<branch>このファイルの名前で$GIT_DIR/branches<head>デフォルトはmasterです。

git fetch uses:git fetchは以下を使用します。

	refs/heads/<head>:refs/heads/<branch>

git push uses:git pushは使用します:

	HEAD:refs/heads/<head>

OUTPUT出力

The output of "git push" depends on the transport method used; this section describes the output when pushing over the Git protocol (either locally or via ssh)."git push"の出力は、使用されている転送方法によって異なります。このセクションでは、Gitプロトコルを(ローカルまたはssh経由で)プッシュしたときの出力について説明します。

The status of the push is output in tabular form, with each line representing the status of a single ref. Each line is of the form:プッシュのステータスは表形式で出力され、各行は単一の参照のステータスを表します。各行は次の形式です。

 <flag> <summary> <from> -> <to> (<reason>)

If --porcelain is used, then each line of the output is of the form:--porcelainを使用すると、出力の各行は次の形式になります。

 <flag> \t <from>:<to> \t <summary> (<reason>)

The status of up-to-date refs is shown only if --porcelain or --verbose option is used.最新の参照のステータスは、--porcelainまたは--verboseオプションが使用されている場合にのみ表示されます。

flag

A single character indicating the status of the ref:参照のステータスを示す1文字

(space) (スペース)

for a successfully pushed fast-forward;早送りに成功したからです。

+

for a successful forced update;強制アップデートが成功した場合

-

for a successfully deleted ref;正常に削除された参照用。

*

for a successfully pushed new ref;新しいrefが正常にプッシュされたため。

!

for a ref that was rejected or failed to push; and拒否された、またはプッシュに失敗した参照用。そして

=

for a ref that was up to date and did not need pushing.最新のもので、プッシュする必要のない参照用です。

summary 概要

For a successfully pushed ref, the summary shows the old and new values of the ref in a form suitable for using as an argument to git log (this is <old>..<new> in most cases, and <old>...<new> for forced non-fast-forward updates).正常にプッシュされたrefの場合、要約にはrefの新旧の値がへの引数として使用するのに適した形式で表示されますgit log(これは<old>..<new>ほとんどの場合、<old>...<new>強制的な早送りではありません)。

For a failed update, more details are given:アップデートが失敗した場合は、詳細が表示されます。

rejected 拒否されました

Git did not try to send the ref at all, typically because it is not a fast-forward and you did not force the update.Gitはrefをまったく送信しようとしませんでした。これは通常、早送りではなく、強制的に更新を行わなかったためです。

remote rejected リモート拒否

The remote end refused the update. Usually caused by a hook on the remote side, or because the remote repository has one of the following safety options in effect: receive.denyCurrentBranch (for pushes to the checked out branch), receive.denyNonFastForwards (for forced non-fast-forward updates), receive.denyDeletes or receive.denyDeleteCurrent. See git-config[1].リモートエンドは更新を拒否しました。通常はリモート側のフック、またはリモートリポジトリに次のいずれかの安全オプションが有効になっているreceive.denyCurrentBranchために発生します。(チェックアウトされたブランチへのプッシュ用)、receive.denyNonFastForwards(強制非早送り更新用)、receive.denyDeletesまたはreceive.denyDeleteCurrent。参照のgit-config設定を[1]

remote failure リモート障害

The remote end did not report the successful update of the ref, perhaps because of a temporary error on the remote side, a break in the network connection, or other transient error.おそらくリモート側の一時的なエラー、ネットワーク接続の切断、またはその他の一時的なエラーが原因で、リモートエンドはrefの正常な更新を報告しませんでした。

from から

The name of the local ref being pushed, minus its refs/<type>/ prefix. In the case of deletion, the name of the local ref is omitted.プッシュされているローカル参照の名前から、そのrefs/<type>/接頭辞を除いたもの。削除の場合、ローカル参照の名前は省略されます。

to

The name of the remote ref being updated, minus its refs/<type>/ prefix.更新されているリモート参照の名前から、そのrefs/<type>/接頭辞を除いたもの。

reason 理由

A human-readable explanation. In the case of successfully pushed refs, no explanation is needed. For a failed ref, the reason for failure is described.人間が読める説明 参照が正常にプッシュされた場合、説明は不要です。参照が失敗した場合は、失敗の理由が説明されています。

NOTE ABOUT FAST-FORWARDS早送りについての注意

When an update changes a branch (or more in general, a ref) that used to point at commit A to point at another commit B, it is called a fast-forward update if and only if B is a descendant of A.更新によって、コミットAを指すブランチ(一般的にはref)が別のコミットBを指すように変更される場合、BがAの子孫である場合に限り、早送り更新と呼ばれます。

In a fast-forward update from A to B, the set of commits that the original commit A built on top of is a subset of the commits the new commit B builds on top of. Hence, it does not lose any history.AからBへの早送りの更新では、元のコミットAが上に構築したコミットのセットは、新しいコミットBが上に構築したコミットのサブセットです。したがって、それは歴史を失うことはありません。

In contrast, a non-fast-forward update will lose history. For example, suppose you and somebody else started at the same commit X, and you built a history leading to commit B while the other person built a history leading to commit A. The history looks like this:対照的に、早送りではない更新は履歴を失います。例えば、あなたと他の誰かが同じコミットXで始めて、コミットBへとつながる歴史を構築し、他の人がコミットAへとつながる歴史を構築したとしましょう。

      B
     /
 ---X---A

Further suppose that the other person already pushed changes leading to A back to the original repository from which you two obtained the original commit X.さらに、他の人がAにつながる変更を元のリポジトリに戻し、元のリポジトリから元のコミットXを取得したとします。

The push done by the other person updated the branch that used to point at commit X to point at commit A. It is a fast-forward.他の人によって行われたプッシュは、コミットXを指すために使用されていたブランチをコミットAを指すように更新しました。これは早送りです。

But if you try to push, you will attempt to update the branch (that now points at A) with commit B. This does not fast-forward. If you did so, the changes introduced by commit A will be lost, because everybody will now start building on top of B.しかし、プッシュしようとすると、コミットBでブランチ(現在はAを指す)を更新しようとします。これは早送りではありませ。そうすると、コミットAによって加えられた変更は失われます。全員がBの上に構築を開始するからです。

The command by default does not allow an update that is not a fast-forward to prevent such loss of history.デフォルトでは、このコマンドは、このような履歴の損失を防ぐための早送りではない更新を許可しません。

If you do not want to lose your work (history from X to B) or the work by the other person (history from X to A), you would need to first fetch the history from the repository, create a history that contains changes done by both parties, and push the result back.自分の仕事(XからBへの履歴)や他人による仕事(XからAへの履歴)を失いたくない場合は、最初にリポジトリから履歴を取得し、変更が行われた履歴を作成する必要があります。両方の当事者によって、そして結果を押し戻す。

You can perform "git pull", resolve potential conflicts, and "git push" the result. A "git pull" will create a merge commit C between commits A and B.あなたは "git pull"を実行し、潜在的な衝突を解決し、そして結果を "git push"することができます。"git pull"はコミットAとBの間にマージコミットCを作成します。

      B---C
     /   /
 ---X---A

Updating A with the resulting merge commit will fast-forward and your push will be accepted.結果として生じるマージコミットでAを更新すると早送りされ、あなたのプッシュは受け入れられます。

Alternatively, you can rebase your change between X and B on top of A, with "git pull --rebase", and push the result back. The rebase will create a new commit D that builds the change between X and B on top of A.あるいは、 "git pull --rebase"を使って、XとBの間の変更をAの上に追加し、結果をプッシュバックすることもできます。リベースは、Aの上にXとBの間の変更を構築する新しいコミットDを作成します。

      B   D
     /   /
 ---X---A

Again, updating A with this commit will fast-forward and your push will be accepted.繰り返しますが、このコミットでAを更新すると早送りし、プッシュは受け入れられます。

There is another common situation where you may encounter non-fast-forward rejection when you try to push, and it is possible even when you are pushing into a repository nobody else pushes into. After you push commit A yourself (in the first picture in this section), replace it with "git commit --amend" to produce commit B, and you try to push it out, because forgot that you have pushed A out already. In such a case, and only if you are certain that nobody in the meantime fetched your earlier commit A (and started building on top of it), you can run "git push --force" to overwrite it. In other words, "git push --force" is a method reserved for a case where you do mean to lose history.プッシュしようとしたときに早送り以外の拒否が発生する可能性がある別の一般的な状況があります。また、他の人がプッシュしているリポジトリにプッシュしているときでも可能です。コミットAを自分でプッシュした後(このセクションの最初の図で)、それを "git commit --amend"に置き換えてコミットBを作成します。これは、すでにプッシュアウトしたことを忘れたためです。そのような場合、そしてその間に誰もあなたの以前のコミットAを取得しなかった(そしてその上にビルドを開始した)と確信できない場合にのみ、あなたはそれを上書きするために "git push --force"を実行できます。言い換えれば、 "git push --force"はあなたが歴史を失うことを意味する場合のために予約された方法です。

EXAMPLES

git push

Works like git push <remote>, where <remote> is the current branch’s remote (or origin, if no remote is configured for the current branch).以下のように動作しgit push <remote>、ここで、<リモート>現在のブランチのリモートである(またはorigin、何もリモートが現在のブランチのために設定されていない場合)を。

git push origin

Without additional configuration, pushes the current branch to the configured upstream (remote.origin.merge configuration variable) if it has the same name as the current branch, and errors out without pushing otherwise.追加の設定がなければ、現在のブランチが現在のブランチとremote.origin.merge同じ名前であれば設定された上流(設定変数)にプッシュし、そうでなければエラーを出します。

The default behavior of this command when no <refspec> is given can be configured by setting the push option of the remote, or the push.default configuration variable.<refspec>が指定されていない場合のこのコマンドのデフォルトの動作はpush、リモートのオプションまたはpush.default設定変数を設定することによって設定できます。

For example, to default to pushing only the current branch to origin use git config remote.origin.push HEAD. Any valid <refspec> (like the ones in the examples below) can be configured as the default for git push origin.たとえば、デフォルトでは現在のブランチのみをorigin使用するようにプッシュしますgit config remote.origin.push HEAD。以下の例にあるような任意の有効な<refspec>をのデフォルトとして設定できますgit push origin

git push origin :

Push "matching" branches to origin. See <refspec> in the OPTIONS section above for a description of "matching" branches.「マッチング」ブランチをに押しoriginます。"マッチング"ブランチの説明については、上記のOPTIONSセクションの<refspec>を参照してください。

git push origin master

Find a ref that matches master in the source repository (most likely, it would find refs/heads/master), and update the same ref (e.g. refs/heads/master) in origin repository with it. If master did not exist remotely, it would be created.masterソースリポジトリで一致する参照を見つけ(たぶんそれが見つかるでしょうrefs/heads/master)、それと一緒refs/heads/masteroriginリポジトリで同じ参照を更新します。masterリモートに存在しない場合は作成されます。

git push origin HEAD

A handy way to push the current branch to the same name on the remote.現在のブランチをリモートの同じ名前にプッシュする便利な方法です。

git push mothership master:satellite/master dev:satellite/dev

Use the source ref that matches master (e.g. refs/heads/master) to update the ref that matches satellite/master (most probably refs/remotes/satellite/master) in the mothership repository; do the same for dev and satellite/dev.master(例えばrefs/heads/master)一致するソース参照を使用してsatellite/master(おそらくrefs/remotes/satellite/mastermothershipリポジトリ内の一致する参照を更新します。とについても同じようにdevsatellite/devます。

See the section describing <refspec>... above for a discussion of the matching semantics.<refspec>...一致するセマンティクスについては、上記のセクションを参照してください。

This is to emulate git fetch run on the mothership using git push that is run in the opposite direction in order to integrate the work done on satellite, and is often necessary when you can only make connection in one way (i.e. satellite can ssh into mothership but mothership cannot initiate connection to satellite because the latter is behind a firewall or does not run sshd).これは、行われた作業を統合するために反対方向にgit fetch実行されるmothership使用時の実行をエミュレートするgit pushためであり、一方向でsatelliteしか接続できない場合に必要になることがよくあります。後者はファイアウォールの背後にあるか、sshdを実行していないためです。

After running this git push on the satellite machine, you would ssh into the mothership and run git merge there to complete the emulation of git pull that were run on mothership to pull changes made on satellite.これを実行した後git pushsatelliteマシン、あなたはにsshを考えmothershipて実行git mergeのエミュレーション完了するために、そこにgit pullそれが上で実行されたmothership上で行われた変更をプルしますsatellite

git push origin HEAD:master

Push the current branch to the remote ref matching master in the origin repository. This form is convenient to push the current branch without thinking about its local name.現在のブランチをリポジトリ内のリモート参照マッチングmasterにプッシュしoriginます。この形式は、ローカル名を考えずに現在のブランチをプッシュするのに便利です。

git push origin master:refs/heads/experimental

Create the branch experimental in the origin repository by copying the current master branch. This form is only needed to create a new branch or tag in the remote repository when the local name and the remote name are different; otherwise, the ref name on its own will work.現在のブランチをコピーexperimentalしてoriginリポジトリにブランチを作成しますmaster。この形式は、ローカル名とリモート名が異なる場合に、リモートリポジトリに新しいブランチまたはタグを作成するためにのみ必要です。それ以外の場合は、参照名自体が機能します。

git push origin :experimental

Find a ref that matches experimental in the origin repository (e.g. refs/heads/experimental), and delete it.一致するREF検索experimentaloriginリポジトリ(例えばrefs/heads/experimental)、およびそれを削除します。

git push origin +dev:master

Update the origin repository’s master branch with the dev branch, allowing non-fast-forward updates. This can leave unreferenced commits dangling in the origin repository. Consider the following situation, where a fast-forward is not possible:オリジンリポジトリのマスターブランチをdevブランチで更新し、早送り以外の更新を許可します。これにより、参照されていないコミットがオリジンリポジトリにぶら下がったままになる可能性があります。早送りができない次のような状況を考えます。

	    o---o---o---A---B  origin/master
		     \
		      X---Y---Z  dev

The above command would change the origin repository to上記のコマンドはオリジンリポジトリを以下のように変更します。

		      A---B  (unnamed branch)
		     /
	    o---o---o---X---Y---Z  master

Commits A and B would no longer belong to a branch with a symbolic name, and so would be unreachable. As such, these commits would be removed by a git gc command on the origin repository.コミットAとBは、もはやシンボリック名を持つブランチに属していないので、到達不能です。そのため、これらのコミットはgit gcオリジンリポジトリのコマンドによって削除されます。

SECURITYセキュリティ

The fetch and push protocols are not designed to prevent one side from stealing data from the other repository that was not intended to be shared. If you have private data that you need to protect from a malicious peer, your best option is to store it in another repository. This applies to both clients and servers. In particular, namespaces on a server are not effective for read access control; you should only grant read access to a namespace to clients that you would trust with read access to the entire repository.フェッチとプッシュのプロトコルは、一方の側が他方のリポジトリから共有することを意図していないデータを盗むのを防ぐようには設計されていません。悪意のある相手から保護する必要があるプライベートデータがある場合、最善の選択肢はそれを別のリポジトリに保存することです。これはクライアントとサーバーの両方に当てはまります。特に、サーバー上の名前空間は読み取りアクセス制御には効果的ではありません。リポジトリ全体への読み取りアクセスで信頼できるクライアントには、ネームスペースへの読み取りアクセスのみを許可する必要があります。

The known attack vectors are as follows:既知の攻撃方法は次のとおりです。

  1. The victim sends "have" lines advertising the IDs of objects it has that are not explicitly intended to be shared but can be used to optimize the transfer if the peer also has them. The attacker chooses an object ID X to steal and sends a ref to X, but isn’t required to send the content of X because the victim already has it. Now the victim believes that the attacker has X, and it sends the content of X back to the attacker later. (This attack is most straightforward for a client to perform on a server, by creating a ref to X in the namespace the client has access to and then fetching it. The most likely way for a server to perform it on a client is to "merge" X into a public branch and hope that the user does additional work on this branch and pushes it back to the server without noticing the merge.)被害者は、共有することを明示的に意図していないが、相手がそれらを持っている場合は転送を最適化するために使用できるオブジェクトのIDをアドバタイズする "have"行を送信します。攻撃者は盗むためにオブジェクトID Xを選び、Xにrefを送りますが、犠牲者が既に持っているのでXの内容を送るために要求されません。これで、被害者は攻撃者にXがあると考え、Xの内容を後で攻撃者に送り返します。(この攻撃は、クライアントがアクセスできる名前空間にXへの参照を作成し、それをフェッチすることによって、クライアントがサーバー上で実行するのが最も簡単です。サーバーがクライアント上でそれを実行するための最も可能性の高い方法です。 "Xをパブリックブランチにマージし、ユーザーがこのブランチに対して追加の作業を行い、マージに気付かずにサーバーにプッシュすることを期待します。)

  2. As in #1, the attacker chooses an object ID X to steal. The victim sends an object Y that the attacker already has, and the attacker falsely claims to have X and not Y, so the victim sends Y as a delta against X. The delta reveals regions of X that are similar to Y to the attacker.#1と同様に、攻撃者は盗むためにオブジェクトID Xを選びます。被害者は攻撃者が既に持っているオブジェクトYを送り、攻撃者は誤ってXではなくXを持っていると主張するので、被害者はYをXに対するデルタとして送ります。デルタはYに似たXの領域を攻撃者に明らかにします。

GIT

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

関連記事

スポンサーリンク

群馬県の電車路線、駅の一覧

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

上に戻る