2016-09-29 1 views
0

フォローアップとしてthis question.gitignoreフィルタを使用している間だけ、現在のディレクトリでトラッキングされていないファイルがどのように表示されますか?

ここには、すべてのuntrackedファイルが表示されています。現在のディレクトリでのみ追跡されていないファイルを表示する方法、.gitignoreを使用する方法、つまり.gitignoreのファイルを表示しないでください。

ありがとうございました

+0

あなたは 'git status --ignored'を試しましたか? –

+0

結果:' error:unknown option ignored ignored' – yuval

+0

gitの古代版を実行しているに違いありません。 [ステータス1.8.1](https://git-scm.com/docs/git-status/1.8.1) –

答えて

1

要件は明確ではありません。その後、

あなたは試合.gitignoreフィルタということだけ人跡未踏のファイルを見たい場合は、

git ls-files --other --exclude-standard --ignored|grep -v/

あなたはに.gitignoreフィルタに一致しないだけ人跡未踏のファイルを表示したい場合

git ls-files --other --exclude-standard|grep -v/

使用オプションgit ls-files

-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.

--exclude-standard Add the standard Git exclusions: .git/info/exclude , .gitignore in each directory, and the user’s global exclusion file.

現在のディレクトリにないファイルは、grepで除外されます。

+0

ありがとうございますが、私はまだファイルを参照しなければなりません。無視される – yuval

+0

@ user2476373どのファイルを表示したいのですか、どのファイルを無視したいですか? – Leon

+1

@ user2476373更新された応答を参照してください – Leon

関連する問題