title: Git - how to include only certain files and dirs from the whole working tree?
body: <p>I am developing an extension for magento. There is a lot of files in working dir, but I need to include in git only those I added in extension. How can I define in .gitignore rules for this case?</p>
  
  <p>I tried this - <strong>.gitignore</strong>:</p>
  
  <pre><code>*
  !/app/etc/modules/Some_Ext.xml
  !/app/code/local/Some/Ext/
  !/app/designer/...
  ... - etc.
  </code></pre>
  
  <p>But when I try <strong>git status</strong> it shows only <strong>.gitignore</strong> itself.</p>
  
  <p>When I replace asterisk with certain dirs it doesn't change anything. What is a proper way to achieve my goal?</p>