Skip to main content
100%

Walk the git tree in pure js

✓ Published0🌍 Public
Aalessioalex
Last edited Jun 11, 2013
Created on Jun 11, 2013

This example walks a Git repository’s object graph, streaming commits, trees, and blobs as they are encountered. It loads the repository with `git-fs-repo`, resolves the HEAD commit via `git.ref('HEAD').hash`, then uses `git-walk-tree` to traverse the commit’s tree hierarchy. Each visited object is logged with `util.inspect`, showing its type and structure, and the code includes commented examples for filtering tree members or dumping blob data. The traversal relies on `git.find.bind(git)` as the lookup callback, demonstrating a pure-JavaScript pipeline from raw `.git` files to parsed objects.

AI-generated description

Similar vizzes