フォローアップとしてthis question.gitignoreフィルタを使用している間だけ、現在のディレクトリでトラッキングされていないファイルがどのように表示されますか?
ここには、すべてのuntrackedファイルが表示されています。現在のディレクトリでのみ追跡されていないファイルを表示する方法、.gitignoreを使用する方法、つまり.gitignoreのファイルを表示しないでください。
ありがとうございました
フォローアップとしてthis question.gitignoreフィルタを使用している間だけ、現在のディレクトリでトラッキングされていないファイルがどのように表示されますか?
ここには、すべてのuntrackedファイルが表示されています。現在のディレクトリでのみ追跡されていないファイルを表示する方法、.gitignoreを使用する方法、つまり.gitignoreのファイルを表示しないでください。
ありがとうございました
要件は明確ではありません。その後、
あなたは試合.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
で除外されます。
あなたは 'git status --ignored'を試しましたか? –
結果:' error:unknown option ignored ignored' – yuval
gitの古代版を実行しているに違いありません。 [ステータス1.8.1](https://git-scm.com/docs/git-status/1.8.1) –