title: Why can't I commit an empty folder in git?
body: <p>Key word here is <strong>why</strong>.  There are plenty of questions where the answer is, "git doesn't allow that" but I want to know <em>why</em> it doesn't allow this.  </p>
  
  <p>I've been reading about <a href="http://aosabook.org/en/git.html" rel="noreferrer">the architecture of git</a> and it has this image in it:</p>
  
  <p><img src="https://i.stack.imgur.com/HCcnn.png" alt="DAG with tree nodes"></p>
  
  <p>This image shows that there <em>are</em> <code>tree</code> nodes.  Technically, it looks like it'd be straight forward to save a <code>tree</code> without any children.  So why does git forbid this?</p>
  
  <p>There's a part in this book that mentions this:</p>
  
  <blockquote>
    <p>For each directory above the changed file (plus the repository root directory), a new tree object is created with a new identifier. <strong>A DAG is created starting from the newly created root tree object pointing to blobs (reusing existing blob references where the files content has not changed in this commit) and referencing the newly created blob in place of that file's previous blob object in the previous tree hierarchy. (A blob represents a file stored in the repository.)</strong></p>
  </blockquote>
  
  <p>I feel like this might be the reason, but it's kind of glossing over the details with respect to what I want answered.</p>