title: Is it possible to make git to track empty folders?
body: <p>I read from this <a href="https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F" rel="noreferrer">post</a> which explains that to make git to track a folder there must atleast an empty file:</p>
  
  <pre><code>Currently the design of the Git index (staging area) only permits files 
  to be listed and nobody competent enough to make the change to allow 
  empty directories has cared enough about this situation to remedy it.
  
  Directories are added automatically when adding files inside them. 
  That is, directories never have to be added to the repository, 
  and are not tracked on their own. You can say "git add &lt;dir&gt;" and it 
  will add the files in there.
  
  If you really need a directory to exist in checkouts you should
  create a file in it.
  </code></pre>
  
  <p>I have faced some problems because git not tracking empty folders, i am list a few:</p>
  
  <p><strong>Problem1</strong>:</p>
  
  <p>I have a <code>apache/log</code> directory in one of my git repository.</p>
  
  <p>when I pushed it to server and run the website it didn't worked. Where it worked fine in my localsystem. after a lot of research i found out that <code>git push</code> did n't pushed the empty folder <code>/log</code>. the serve checked folder log to create logfiles. since folder <code>log</code> did not exist, it is not possible to automatically create a folder and put these files. That is why the error.</p>
  
  <p><strong>Problem2</strong>: </p>
  
  <p>I have lots of <code>branch</code>. Only one of my particular branch say <code>frontend</code> have folder <code>caps</code>.</p>
  
  <p>Sometime one of a folder in the directory <code>my_git_repo/caps/html/home/</code> will be empty.</p>
  
  <p>branch <code>master</code> doesn't have folder <code>caps</code></p>
  
  <p>if i make <code>git checkout master</code> it will have empty folder ie <code>caps/html/home/tmp</code>
  so i want to manually delete the folder <code>caps</code> sometimes it will create confusion.</p>
  
  <p><strong>usually i solve these problems by putting an empty file(<code>README</code>) in the folder.</strong></p>
  
  <h3>So I would like to make git to track all empty folders. is it possible by editing <code>.git/config</code> or something?</h3>
  
  <p>Any help will be appriciated.:))</p>