Practical overview
When it fits
Use Git2Txt when you need a text-file export of a public GitHub repository to supply as context for later analysis, review, or documentation.
Who it is for
- Developers preparing public repository source text for LLM analysis.
- People who want a single text artifact for repository review or documentation.
Documented uses
- Combine repository file contents into one text export while preserving relative paths.
- Exclude binary files and, by default, files larger than 100 KB.
- Change the size threshold, include all files, or specify an output path.
Requirements & limits
Git2Txt is installed as a command-line tool with npm and supports Windows, macOS, and Linux. Its documented repository input is public GitHub content.
- Files larger than 100 KB are excluded by default; the threshold is configurable in MB.
- Binary files are excluded by default, while
--include-allbypasses size and type filtering. - The tool processes subdirectories recursively but excludes
node_modulesand.git. - The repository can be specified as an HTTPS URL, owner/repository shorthand, or SSH URL.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install Git2Txt and export a public repository
Create one text file from a public GitHub repository using the documented default filters.
Before you start
- npm
- A public GitHub repository, supplied as an HTTPS URL, owner/repository shorthand, or SSH URL
- Windows, macOS, or Linux
Steps
Install the CLI globally with the command below.
npm install -g git2txtRun
git2txtfollowed by the repository address or shorthand.Find the generated file in the current directory; by default it is named after the repository.
Expected outcome
A single text file containing repository file paths and contents, with binary files and files larger than 100 KB excluded by default.
Guide limitations
- The documented command downloads public GitHub repositories.
- The default processing excludes the
node_modulesand.gitdirectories.
Set an output path or change file inclusion
Adjust the generated text file’s destination or the default size and type filters.
Before you start
- Git2Txt installed through npm
- A public GitHub repository address or owner/repository shorthand
Steps
Add
--output=output.txtto choose a file path.Use
--threshold=2to set the size threshold to 2 MB, or choose another threshold in MB.Use
--include-allto include files regardless of size or type.
Expected outcome
The export uses the requested output path or inclusion settings.
Guide limitations
- The documented
--include-alloption disables size and type filtering, including the usual binary exclusion.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 10 November 2026
- Original website title
- addyosmani/git2txt · Official homepage title · retained in its source language

