0

How do I get the repository size (total storage used) using JGit? I am using DFS Repository. I tried searching the documentation, but there doesn't seem to be anything out of the box to get the storage size of the repository.

rohanagarwal
  • 711
  • 8
  • 30
  • Does this answer your question? [JGit: Count objects](https://stackoverflow.com/questions/7584616/jgit-count-objects) – Yassin Hajaj Mar 29 '21 at 19:00
  • It is for counting the objects, I want the space occupied by the repository. If there is no out of the box solution, then what is the best way to achieve this? – rohanagarwal Mar 29 '21 at 19:11
  • I think JGit is not a good tool for this as the occupied size depends on many things like compression and there can be "lost" objects still lingering on, which are not accessible via JGit. You can just use functionality which measures the size of directories, e.g. see https://stackoverflow.com/a/11285406/411846 – centic Mar 30 '21 at 19:18

0 Answers0