Does anyone have an example of using git hash-object on a directory? It works easily enough on a file* but doesn\'t work as I\'d expect for a directory**
*:
After long searching I found the following command:
git write-tree
Source: http://git-scm.com/docs/git-write-tree
I used it to recover the missing directory:
git write-tree path/to/missing/folder
And my missing tree object got created. From here you can continue using:
git hash-object -w path/to/missing/folder/file.txt
As explained in: https://git.wiki.kernel.org/index.php/GitFaq#How_to_fix_a_broken_repository.3F