title: git ignore directories "build" and all their contents but not "build.xml"
body: <p>I am using <strong>git</strong> in a project where <strong>Ant</strong> is the build system.
  Since I do not wish to add "build" directories to <strong>git</strong> but need to add <strong>build.xml</strong> files I have resorted to the following two lines in my <strong>.gitignore</strong> files:</p>
  
  <pre><code>build/
  !build.xml
  </code></pre>
  
  <p>Is there a better / more concise way ?</p>
  
  <p><strong>UPDATE:</strong>
  turns out <strong>build.xml</strong> was ignored due to a <strong>.gitignore</strong> in a directory higher up the path. Once that was removed, <strong>build/</strong> correctly ignores only the build folder, not the <strong>build.xml</strong> file beside it.</p>