ls-files

NAME

git-ls-files - Show information about files in the index and the working treegit-ls-files - インデックスと作業ツリーのファイルに関する情報を表示する

SYNOPSIS概要

git ls-files [-z] [-t] [-v] [-f]
		(--[cached|deleted|others|ignored|stage|unmerged|killed|modified])*
		(-[c|d|o|i|s|u|k|m])*
		[--eol]
		[-x <pattern>|--exclude=<pattern>]
		[-X <file>|--exclude-from=<file>]
		[--exclude-per-directory=<file>]
		[--exclude-standard]
		[--error-unmatch] [--with-tree=<tree-ish>]
		[--full-name] [--recurse-submodules]
		[--abbrev] [--] [<file>…​]

DESCRIPTION説明

This merges the file listing in the directory cache index with the actual working directory list, and shows different combinations of the two.これは、ディレクトリキャッシュインデックス内のファイルリストを実際の作業ディレクトリリストとマージし、2つの異なる組み合わせを表示します。

One or more of the options below may be used to determine the files shown:表示されているファイルを確認するには、以下の1つ以上のオプションを使用します。

OPTIONSオプション

-c
--cached - キャッシュ

Show cached files in the output (default)キャッシュされたファイルを出力に表示する(デフォルト)

-d
--deleted - 削除済み

Show deleted files in the output削除したファイルを出力に表示する

-m
--modified - 修正

Show modified files in the output変更されたファイルを出力に表示する

-o
--others - その他

Show other (i.e. untracked) files in the output出力に他の(つまり追跡されていない)ファイルを表示する

-i -私
--ignored - 無視された

Show only ignored files in the output. When showing files in the index, print only those matched by an exclude pattern. When showing "other" files, show only those matched by an exclude pattern. Standard ignore rules are not automatically activated, therefore at least one of the --exclude* options is required.無視されたファイルのみを出力に表示します。インデックス内のファイルを表示するときは、除外パターンで一致したファイルのみを印刷してください。「その他の」ファイルを表示するときは、除外パターンで一致したものだけを表示します。標準の無視規則は自動的にはアクティブにならないため、少なくとも1つの--exclude*オプションが必要です。

-s
--stage - ステージ

Show staged contents' mode bits, object name and stage number in the output.ステージコンテンツのモードビット、オブジェクト名、ステージ番号を出力に表示します。

--directory - ディレクトリ

If a whole directory is classified as "other", show just its name (with a trailing slash) and not its whole contents.ディレクトリ全体が "other"として分類されている場合は、その内容全体ではなく、その名前だけを(末尾にスラッシュを付けて)表示します。

--no-empty-directory

Do not list empty directories. Has no effect without --directory.空のディレクトリをリストしません。--directoryなしでは効果がありません。

-u
--unmerged - 未統合

Show unmerged files in the output (forces --stage)マージされていないファイルを出力に表示します(--stageを強制します)

-k
--killed - 殺された

Show files on the filesystem that need to be removed due to file/directory conflicts for checkout-index to succeed.checkout-indexが成功するためには、ファイル/ディレクトリの競合が原因で削除する必要があるファイルシステム上のファイルを表示します。

-z

%%BODY%% line termination on output and do not quote filenames. See OUTPUT below for more information.出力時に\ 0改行を行い、ファイル名をクォートしません。詳細については、下記のOUTPUTを参照してください。

-x <pattern> -x <パターン>
--exclude=<pattern> --exclude = <パターン>

Skip untracked files matching pattern. Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS below for more information.パターンに一致する追跡されていないファイルをスキップします。patternはシェルのワイルドカードパターンです。詳細については、下記の除外パターンを参照してください。

-X <file> -X <ファイル>
--exclude-from=<file> --exclude-from = <ファイル>

Read exclude patterns from <file>; 1 per line.<file>から除外パターンを読み取ります。1行に1つ

--exclude-per-directory=<file> --exclude-per-directory = <ファイル>

Read additional exclude patterns that apply only to the directory and its subdirectories in <file>.<file>内のディレクトリとそのサブディレクトリにのみ適用される追加の除外パターンを読んでください。

--exclude-standard

Add the standard Git exclusions: .git/info/exclude, .gitignore in each directory, and the user’s global exclusion file.標準のGitの除外、各ディレクトリの.git / info / exclude、.gitignore、およびユーザーのグローバル除外ファイルを追加します。

--error-unmatch - エラー不一致

If any <file> does not appear in the index, treat this as an error (return 1).インデックスに<file>が含まれていない場合は、これをエラーとして扱います(1を返します)。

--with-tree=<tree-ish> --with-tree = <ツリー>

When using --error-unmatch to expand the user supplied <file> (i.e. path pattern) arguments to paths, pretend that paths which were removed in the index since the named <tree-ish> are still present. Using this option with -s or -u options does not make any sense.--error-unmatchを使用してユーザーが指定した<file>(つまりパスパターン)引数をパスに展開するときは、名前付きの<tree-ish>以降にインデックスから削除されたパスがまだ存在するように見せかけます。このオプションを-sor オプションと一緒に-u使用しても意味がありません。

-t

This feature is semi-deprecated. For scripting purpose, git-status[1] --porcelain and git-diff-files[1] --name-status are almost always superior alternatives, and users should look at git-status[1] --short or git-diff[1] --name-status for more user-friendly alternatives.この機能は非推奨です。スクリプティングの目的では、git-status [1] --porcelaingit-diff-files [1] --name-statusはほとんど常に優れた選択肢であり、ユーザーにとってより使いやすい選択肢はgit-status [1] --shortまたはgit-diff [1] --name-statusを見るべきです。

This option identifies the file status with the following tags (followed by a space) at the start of each line:このオプションは、各行の先頭にあるファイルステータスを次のタグ(後ろにスペース)を付けて識別します。

H

cachedキャッシュされた

S

skip-worktreeスキップワークツリー

M

unmerged未マージ

R

removed/deleted削除/削除

C

modified/changed修正/変更

K

to be killed殺される

?

otherその他の

-v

Similar to -t, but use lowercase letters for files that are marked as assume unchanged (see git-update-index[1]).と同じですが-t変更されていないと想定されるファイルには小文字を使用します(git-update-index [1]を参照)。

-f

Similar to -t, but use lowercase letters for files that are marked as fsmonitor valid (see git-update-index[1]).fsmonitorが有効-tであるとマークされているファイルには似ていますが小文字を使用します(git-update-index [1]を参照)。

--full-name - フルネーム

When run from a subdirectory, the command usually outputs paths relative to the current directory. This option forces paths to be output relative to the project top directory.サブディレクトリから実行すると、コマンドは通常、現在のディレクトリからの相対パスを出力します。このオプションを選択すると、パスはプロジェクトのトップディレクトリからの相対パスで出力されます。

--recurse-submodules

Recursively calls ls-files on each submodule in the repository. Currently there is only support for the --cached mode.リポジトリ内の各サブモジュールのlsファイルを再帰的に呼び出します。現在のところ--cachedモードのみがサポートされています。

--abbrev[=<n>] --abbrev [= <n>]

Instead of showing the full 40-byte hexadecimal object lines, show only a partial prefix. Non default number of digits can be specified with --abbrev=<n>.全40バイトの16進数オブジェクト行を表示する代わりに、部分的な接頭辞のみを表示します。--abbrev = <n>を使用して、デフォルト以外の桁数を指定できます。

--debug - デバッグ

After each line that describes a file, add more data about its cache entry. This is intended to show as much information as possible for manual inspection; the exact format may change at any time.ファイルを記述する各行の後に、そのキャッシュエントリに関するデータを追加します。これは手動検査のためにできるだけ多くの情報を表示することを目的としています。正確なフォーマットはいつでも変わるかもしれません。

--eol

Show <eolinfo> and <eolattr> of files. <eolinfo> is the file content identification used by Git when the "text" attribute is "auto" (or not set and core.autocrlf is not false). <eolinfo> is either "-text", "none", "lf", "crlf", "mixed" or "".ファイルの<eolinfo>と<eolattr>を表示します。<eolinfo>は、 "text"属性が "auto"の場合(または設定されておらず、core.autocrlfがfalseではない場合)にGitによって使用されるファイルコンテンツIDです。<eolinfo>は "-text"、 "none"、 "lf"、 "crlf"、 "mixed"、または ""です。

"" means the file is not a regular file, it is not in the index or not accessible in the working tree.""は、ファイルが通常のファイルではないこと、インデックスに存在しないこと、または作業ツリーでアクセスできないことを意味します。

<eolattr> is the attribute that is used when checking out or committing, it is either "", "-text", "text", "text=auto", "text eol=lf", "text eol=crlf". Since Git 2.10 "text=auto eol=lf" and "text=auto eol=crlf" are supported.<eolattr>は、チェックアウトまたはコミット時に使用される属性です。 ""、 " - text"、 "text"、 "text = auto"、 "text eol = lf"、 "text eol = crlf"のいずれかです。Git 2.10から "text = auto eol = lf"と "text = auto eol = crlf"がサポートされています。

Both the <eolinfo> in the index ("i/<eolinfo>") and in the working tree ("w/<eolinfo>") are shown for regular files, followed by the ("attr/<eolattr>").インデックス( "i / <eolinfo>")と作業ツリー( "w / <eolinfo>")の両方に<eolinfo>が表示され、その後に( "attr / <eolattr>")が表示されます。

-- -

Do not interpret any more arguments as options.これ以上引数をオプションとして解釈しないでください。

<file> <ファイル>

Files to show. If no files are given all files which match the other specified criteria are shown.表示するファイル ファイルが指定されていない場合は、他の指定された基準に一致するすべてのファイルが表示されます。

OUTPUT出力

git ls-files just outputs the filenames unless --stage is specified in which case it outputs:--stage指定しない限り、git ls-filesは単にファイル名を出力します。

[<tag> ]<mode> <object> <stage> <file>

git ls-files --eol will show i/<eolinfo><SPACES>w/<eolinfo><SPACES>attr/<eolattr><SPACE*><TAB><file>git ls-files --eolはi / <eolinfo> <SPACES> w / <eolinfo> <SPACES> attr / <eolattr> <SPACE *> <TAB> <file>を表示します。

git ls-files --unmerged and git ls-files --stage can be used to examine detailed information on unmerged paths.git ls-files --unmergedおよびgit ls-files --stageを使用して、マージされていないパスに関する詳細情報を調べることができます。

For an unmerged path, instead of recording a single mode/SHA-1 pair, the index records up to three such pairs; one from tree O in stage 1, A in stage 2, and B in stage 3. This information can be used by the user (or the porcelain) to see what should eventually be recorded at the path. (see git-read-tree[1] for more information on state)マージされていないパスの場合、シングルモード/ SHA-1ペアを記録する代わりに、インデックスは最大3つのペアを記録します。ステージ1のツリーO、ステージ2のA、ステージ3のBからの情報です。この情報は、最終的にパスに記録される内容を確認するためにユーザー(または磁器)が使用できます。(状態の詳細についてはgit-read-tree [1]を参照してください)

Without the -z option, pathnames with "unusual" characters are quoted as explained for the configuration variable core.quotePath (see git-config[1]). Using -z the filename is output verbatim and the line is terminated by a NUL byte.この-zオプションがなければ、"変わった"文字を含むパス名は設定変数で説明されているように引用符で囲まれますcore.quotePathgit-config [1]を参照)。-zファイル名を使用すると逐語的に出力され、行はNULバイトで終了します。

EXCLUDE PATTERNS除外パターン

git ls-files can use a list of "exclude patterns" when traversing the directory tree and finding files to show when the flags --others or --ignored are specified. gitignore[5] specifies the format of exclude patterns.git ls-filesは、ディレクトリツリーをたどってフラグ--othersまたは--ignoredが指定されているときに表示するファイルを見つけるときに、「除外パターン」のリストを使用できます。gitignore [5]は、除外パターンのフォーマットを指定します。

These exclude patterns come from these places, in order:これらの除外パターンは、次の順序でこれらの場所から来ます。

  1. The command-line flag --exclude=<pattern> specifies a single pattern. Patterns are ordered in the same order they appear in the command line.コマンドラインフラグ--exclude = <pattern>は単一のパターンを指定します。パターンはコマンドラインに現れるのと同じ順序で並べられます。

  2. The command-line flag --exclude-from=<file> specifies a file containing a list of patterns. Patterns are ordered in the same order they appear in the file.コマンドラインフラグ--exclude-from = <file>は、パターンのリストを含むファイルを指定します。パターンはファイルに現れるのと同じ順序で並べられます。

  3. The command-line flag --exclude-per-directory=<name> specifies a name of the file in each directory git ls-files examines, normally .gitignore. Files in deeper directories take precedence. Patterns are ordered in the same order they appear in the files.コマンドラインフラグ--exclude-per-directory = <name> は、通常、gs ls-filesが調べる各ディレクトリ内のファイルの名前を指定します.gitignore。より深いディレクトリにあるファイルが優先されます。パターンはファイルに現れるのと同じ順序で並べられます。

A pattern specified on the command line with --exclude or read from the file specified with --exclude-from is relative to the top of the directory tree. A pattern read from a file specified by --exclude-per-directory is relative to the directory that the pattern file appears in.--excludeを使用してコマンドラインで指定されたパターン、または--exclude-fromで指定されたファイルから読み取られたパターンは、ディレクトリツリーの先頭からの相対パスです。--exclude-per-directoryで指定されたファイルから読み取られたパターンは、パターンファイルが存在するディレクトリに対する相対パスです。

SEE ALSO関連項目

git-read-tree[1], gitignore[5]git-read-tree [1]gitignore [5]

GIT

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

関連記事

スポンサーリンク

onSelect

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

上に戻る