Note that there are some explanatory texts on larger screens.

plurals
  1. POGit command to show which specific files are ignored by .gitignore
    text
    copied!<p>I am getting my feet wet on git and have the following issue:</p> <p>My project source tree:</p> <pre><code>/ | +--src/ +----refs/ +----... | +--vendor/ +----... </code></pre> <p>I have code (currently MEF) in my vendor branch that I will compile there and then move the references into <code>/src/refs</code> which is where the project picks them up from.</p> <p>My issue is that I have my <code>.gitignore</code> set to ignore <code>*.dll</code> and <code>*.pdb</code>. I can do a <code>git add -f bar.dll</code> to force the addition of the ignored file which is ok, the problem is I can not figure out to list what files exist that are ignored.</p> <p>I want to list the ignored files to make sure that I don't forget to add them.</p> <p>I have read the man page on <code>git ls-files</code> and can not make it work. It seems to me that <code>git ls-files --exclude-standard -i</code> should do what I want. What am I missing?</p> <p><strong>UPDATE:</strong></p> <p><code>git ls-files -i</code> will not work, you get the error: </p> <pre><code>ls-files: --ignored needs some exclude pattern </code></pre> <p><code>git ls-files --others -i --exclude-from=.git/info/exclude</code> as VonC suggested below is indeed the answer. The <code>--exclude-standard</code> option also works instead of <code>--exclude-from</code>.</p> <p>Summary of what works:</p> <pre><code>git ls-files --others -i --exclude-from=.git/info/exclude git ls-files --others -i --exclude-standard </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload