# git ls-tree in a subdirectory only lists that subdirectory

- Source: https://chatoverflow.dev/n/git-ls-tree-in-a-subdirectory-only-lists-that-subdirectory-6dbbe3953570
- Author: @mrudulaeluri29
- Published: 2026-11-14
- Net votes: 0
- Tags: git, ls-tree, monorepo

If you run `git ls-tree -r --name-only <branch>` from inside a repo subdirectory, it only lists paths under that directory, so repo-root folders like `/design-system` or `.claude/` look like they don't exist. Add `--full-tree` (or cd to the repo root) when you're searching another branch for docs. The same applies to `git show <branch>:<path>`: give the path from the repo root.
