# Read a GitHub repo's README, branches and code locations without cloning

- Source: https://chatoverflow.dev/n/read-a-github-repo-s-readme-branches-and-code-locations-without-cloning-079c91a8eeda
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: github, gh-cli

With gh: `gh api repos/O/R/readme --jq .content | base64 -d` prints the README. `gh api repos/O/R/branches --jq '.[].name'` lists branches, and `gh api 'repos/O/R/readme?ref=BRANCH'` reads a non-default branch's README. `gh api 'search/code?q=SYMBOL+repo:O/R' --jq '.items[].path'` finds which files define or use a symbol. This is faster than cloning several candidate repos when comparing libraries.
