clean

NAME

git-clean - Remove untracked files from the working treegit-clean - 作業ツリーから追跡されていないファイルを削除する

SYNOPSIS概要

git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>…​

DESCRIPTION説明

Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.現在のディレクトリから開始して、バージョン管理下にないファイルを再帰的に削除して作業ツリーを消去します。

Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed. This can, for example, be useful to remove all build products.通常、Gitに知られていないファイルのみが削除され-xますが、このオプションが指定されている場合は、無視されたファイルも削除されます。たとえば、これはすべてのビルド製品を削除するのに役立ちます。

If any optional <path>... arguments are given, only those paths are affected.オプションの<path>...引数が与えられた場合、それらのパスだけが影響を受けます。

OPTIONSオプション

-d

Remove untracked directories in addition to untracked files. If an untracked directory is managed by a different Git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.追跡されていないファイルに加えて、追跡されていないディレクトリを削除します。追跡されていないディレクトリが別のGitリポジトリによって管理されている場合、デフォルトでは削除されません。このようなディレクトリを本当に削除したい場合は、-fオプションを2回使用してください。

-f
--force - 力

If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or directories unless given -f, -n or -i. Git will refuse to delete directories with .git sub directory or file unless a second -f is given.Git構成変数clean.requireForceがfalseに設定されていない場合、git cleanは、-f、-n、または-iが指定されていない限り、ファイルまたはディレクトリの削除を拒否します。2番目の-fが与えられない限り、Gitは.gitサブディレクトリまたはファイルを持つディレクトリの削除を拒否します。

-i -私
--interactive - インタラクティブ

Show what would be done and clean files interactively. See “Interactive mode” for details.何が行われるかを示し、対話形式でファイルを消去します。詳細は「インタラクティブモード」をご覧ください。

-n
--dry-run

Don’t actually remove anything, just show what would be done.実際に何かを削除するのではなく、何が行われるのかを示すだけです。

-q
--quiet - 静か

Be quiet, only report errors, but not the files that are successfully removed.静かにして、エラーのみを報告し、正常に削除されたファイルは報告しないでください。

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

In addition to those found in .gitignore (per directory) and $GIT_DIR/info/exclude, also consider these patterns to be in the set of the ignore rules in effect..gitignore(ディレクトリごと)および$ GIT_DIR / info / excludeにあるものに加えて、これらのパターンも有効な無視規則のセット内にあると見なします。

-x -バツ

Don’t use the standard ignore rules read from .gitignore (per directory) and $GIT_DIR/info/exclude, but do still use the ignore rules given with -e options. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build..gitignore(ディレクトリごと)および$ GIT_DIR / info / excludeから読み取られる標準の無視規則を使用しないでください。ただし、-eオプションで指定された無視規則を使用してください。これにより、ビルド製品を含むすべての追跡されていないファイルを削除できます。これは(おそらくgit resetと組み合わせて)クリーンビルドをテストするための純粋な作業ディレクトリを作成するために使用することができます。

-X -バツ

Remove only files ignored by Git. This may be useful to rebuild everything from scratch, but keep manually created files.Gitによって無視されたファイルのみを削除します。これは、すべてを最初から再構築するのに役立ちますが、手動で作成されたファイルを保持します。

Interactive modeインタラクティブモード

When the command enters the interactive mode, it shows the files and directories to be cleaned, and goes into its interactive command loop.コマンドが対話モードに入ると、クリーンアップするファイルとディレクトリが表示され、その対話コマンドループに入ります。

The command loop shows the list of subcommands available, and gives a prompt "What now> ". In general, when the prompt ends with a single >, you can pick only one of the choices given and type return, like this:コマンドループは利用可能なサブコマンドのリストを表示し、プロンプト "What now>"を与えます。一般に、プロンプトが単一の>で終わっている場合は、次のように、与えられた選択肢のうち1つだけを選択してreturnキーを押すことができます。

    *** Commands ***
	1: clean                2: filter by pattern    3: select by numbers
	4: ask each             5: quit                 6: help
    What now> 1

You also could say c or clean above as long as the choice is unique.あなたも言うことができるcか、clean限り選択が一意であるとして上記。

The main command loop has 6 subcommands.メインコマンドループには6つのサブコマンドがあります。

clean クリーン

Start cleaning files and directories, and then quit.ファイルとディレクトリのクリーニングを開始して、終了します。

filter by pattern パターンで絞り込む

This shows the files and directories to be deleted and issues an "Input ignore patterns>>" prompt. You can input space-separated patterns to exclude files and directories from deletion. E.g. "*.c *.h" will excludes files end with ".c" and ".h" from deletion. When you are satisfied with the filtered result, press ENTER (empty) back to the main menu.これは削除されるべきファイルおよびディレクトリを示し、「Input ignore patterns >>」プロンプトを出します。ファイルとディレクトリを削除対象から除外するには、スペース区切りのパターンを入力します。例えば ??"* .c * .h"は ".c"と ".h"で終わるファイルを削除から除外します。フィルタリングされた結果に満足したら、ENTER(空)を押してメインメニューに戻ります。

select by numbers 数字で選ぶ

This shows the files and directories to be deleted and issues an "Select items to delete>>" prompt. When the prompt ends with double >> like this, you can make more than one selection, concatenated with whitespace or comma. Also you can say ranges. E.g. "2-5 7,9" to choose 2,3,4,5,7,9 from the list. If the second number in a range is omitted, all remaining items are selected. E.g. "7-" to choose 7,8,9 from the list. You can say * to choose everything. Also when you are satisfied with the filtered result, press ENTER (empty) back to the main menu.これにより、削除されるファイルとディレクトリが表示され、「削除するアイテムを選択する>>」というプロンプトが表示されます。このようにプロンプ??トが二重>>で終わっている場合は、空白またはコンマで連結して複数の選択を行うことができます。また範囲を言うことができます。例えば ??"2-5 7,9"はリストから2,3,4,5,7,9を選択します。範囲内の2番目の数字を省略すると、残りのすべての項目が選択されます。例えば ??"7-"はリストから7,8,9を選択するためのものです。あなたはすべてを選ぶために*と言うことができます。また、フィルタリングされた結果に満足したら、ENTER(空)を押してメインメニューに戻ります。

ask each それぞれ尋ねる

This will start to clean, and you must confirm one by one in order to delete items. Please note that this action is not as efficient as the above two actions.これはきれいになり始めます、そしてあなたはアイテムを削除するために一つずつ確認しなければなりません。このアクションは上記の2つのアクションほど効率的ではないことに注意してください。

quit 終了する

This lets you quit without do cleaning.これにより、クリーニングを行わずに終了できます。

help 助けて

Show brief usage of interactive git-clean.対話式git-cleanの簡単な使い方を見せる。

SEE ALSO関連項目

gitignore[5]ジチニョーレ[5]

GIT

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

関連記事

スポンサーリンク

SSDの現在のTBWを調べる方法 SSDの残り寿命 (Windows Linux CentOS)

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

上に戻る