symbolic-ref

NAME

git-symbolic-ref - Read, modify and delete symbolic refsgit-symbolic-ref - シンボリック参照の読み込み、変更、削除

SYNOPSIS概要

git symbolic-ref [-m <reason>] <name> <ref>
git symbolic-ref [-q] [--short] <name>
git symbolic-ref --delete [-q] <name>

DESCRIPTION説明

Given one argument, reads which branch head the given symbolic ref refers to and outputs its path, relative to the .git/ directory. Typically you would give HEAD as the <name> argument to see which branch your working tree is on.引数を1つ指定して、指定されたシンボリック参照がどのブランチヘッドを参照しているかを読み取り、.git/ディレクトリからの相対パスを出力します。通常HEAD、作業ツリーがどのブランチにあるかを見るために、<name>引数として与えます。

Given two arguments, creates or updates a symbolic ref <name> to point at the given branch <ref>.2つの引数が与えられると、与えられたブランチ<ref>を指すようにシンボリックref <name>を作成または更新します。

Given --delete and an additional argument, deletes the given symbolic ref.与えられ--deleteた引数と追加の引数で、与えられたシンボリック参照を削除します。

A symbolic ref is a regular file that stores a string that begins with ref: refs/. For example, your .git/HEAD is a regular file whose contents is ref: refs/heads/master.シンボリック参照は、で始まる文字列を格納する通常のファイルですref: refs/。たとえば、あなたの.git/HEAD内容は普通のファイルですref: refs/heads/master

OPTIONSオプション

-d
--delete - 削除

Delete the symbolic ref <name>.シンボリック参照<名前>を削除します。

-q
--quiet - 静か

Do not issue an error message if the <name> is not a symbolic ref but a detached HEAD; instead exit with non-zero status silently.<name>がシンボリック参照ではなく、切り離されたHEADである場合、エラーメッセージを発行しません。代わりに、ゼロ以外のステータスで黙って終了します。

--short - ショート

When showing the value of <name> as a symbolic ref, try to shorten the value, e.g. from refs/heads/master to master.<name>の値をシンボリック参照として表示するときは、値を短くしてください(例:refs/heads/masterto)master

-m

Update the reflog for <name> with <reason>. This is valid only when creating or updating a symbolic ref.<名前>のreflogを<理由>で更新します。これはシンボリック参照を作成または更新するときにのみ有効です。

NOTESノート

In the past, .git/HEAD was a symbolic link pointing at refs/heads/master. When we wanted to switch to another branch, we did ln -sf refs/heads/newbranch .git/HEAD, and when we wanted to find out which branch we are on, we did readlink .git/HEAD. But symbolic links are not entirely portable, so they are now deprecated and symbolic refs (as described above) are used by default.以前.git/HEADは、シンボリックリンクが指していましたrefs/heads/master。私たちが別のブランチに切り替えたいとき、私たちはしましたln -sf refs/heads/newbranch .git/HEAD、そして私たちがどのブランチにいるのかを知りたいとき、私たちはしましたreadlink .git/HEAD。しかし、シンボリックリンクは完全に移植性があるわけではないので、現在は推奨されておらず、(上記のように)シンボリック参照がデフォルトで使用されています。

git symbolic-ref will exit with status 0 if the contents of the symbolic ref were printed correctly, with status 1 if the requested name is not a symbolic ref, or 128 if another error occurs.git symbolic-refは、シンボリック参照の内容が正しく印刷された場合はステータス0で終了し、要求された名前がシンボリック参照ではない場合はステータス1で終了し、別のエラーが発生した場合は128で終了します。

GIT

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

関連記事

スポンサーリンク

Math.random

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

上に戻る