Thread (8 messages) 8 messages, 5 authors, 2016-06-15

Re: Enumerating all objects in the Git object store

flat view

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:48:30

Am 3/26/2010 16:31, schrieb Paul Richards:
Is there a way to enumerate all the objects in the Git
object store, and for each one figure out its type (commit, tree, or
blob) and obtain a list of the objects it references?  If not, is
there a way to do this for a single object at a time?  (I can then
simply recurse through the whole structure.)
Use 'git rev-list --objects --all' to find all objects connected to all
refs (use something else than --all if you want to). Do *not* look at the
path that the tree and blob objects have attached - it is not authorative
information.

Use 'git cat-file -t' to find the type.

Use 'git cat-file -p' to pretty-print the content of an object. Parse it
depending on the type that you find.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help