<p>This is sort of a follow-up to <a href="https://stackoverflow.com/questions/223678">this question</a>.</p>

<p>If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical.  How would one go about finding all duplicate files for a given tree?  </p>

<p>Would you have to walk the tree and look for duplicate hashes, or does git provide backlinks from each blob to all files in a tree that reference it?</p>

The scripting answers from your linked question pretty much apply here too.
Try the following git command from the root of your git repository.
```
```
git ls-tree -r HEAD
```
```
This generates a recursive list of all 'blobs' in the current HEAD, including their path and their sha1 id.
git doesn't maintain back links from a blob to tree so it would be a scripting task (perl, python?) to parse a
```
git ls-tree -r
```
output and create a summary report of all sha1s that appear more than once in the list.