title: Is git's semi-secret empty tree object reliable, and why is there not a symbolic name for it?
body: <p>Git has a well-known, or at least sort-of-well-known, empty tree whose SHA1 is:</p>
  <pre><code>4b825dc642cb6eb9a060e54bf8d69288fbee4904
  </code></pre>
  <p>(you can see this in any repo, even a newly created one, with <code>git cat-file -t</code> and <code>git cat-file -p</code>).  [<strong>Edit made in 2020</strong>: the SHA-256 empty tree hash ID is:</p>
  <pre><code>6ef19b41225c5369f1c104d45d8d85efa9b057b53b14b4b9b939dd74decc5321
  </code></pre>
  <p>as <a href="https://stackoverflow.com/a/9766506/1256452">VonC mentions in his answer</a>.  My question was apparently about 8 years early. ]</p>
  <p>If you work hard and are very careful you can sort of use this empty tree to store a directory that has no files (see <a href="https://stackoverflow.com/a/8944077/1256452">answer to How do I add an empty directory to a git repository</a>), although it's not really a great idea.</p>
  <p>It's more useful as one argument to <code>git diff-tree</code>, which one of the sample hooks does.</p>
  <p>What I'm wondering is,</p>
  <ol>
  <li>how reliable is this—i.e., will some future version of git not have a git object numbered <code>4b825dc642cb6eb9a060e54bf8d69288fbee4904</code>?</li>
  <li>Why is there no symbolic name for the empty tree (or is there one?).</li>
  </ol>
  <p>(A quick and dirty way to create a symbolic name is to put the SHA1 in, e.g., <code>.git/Nulltree</code>.  Unfortunately you have to do this for every repo.  Seems better to just put the magic number in scripts, etc.  I just have a general aversion to magic numbers.)</p>