GitLoader
GitLoader reads the text files of a branch of a Git repository and passes the content of each one to the flow, along with its path and name. If you give it the repository’s address, it downloads it first. Files that are not text, such as images or executables, are skipped.
When to use it
- Load a software project’s documentation into a knowledge base.
- Have an agent explain or review the code of a repository.
- Find which files contain a specific text.
Configuration
| Field | What it does |
|---|---|
| Repository Path (required) | The folder where the repository is, or where it is downloaded if you fill in Clone URL. |
| Clone URL | The repository’s address, to download it into Repository Path. |
| Branch | The branch the files are read from. Default: main. |
Advanced options
| Field | What it does |
|---|---|
| File Filter | Patterns for the files that are read, separated by commas. For example, *.md reads only Markdown files and !*.py reads everything except Python files. |
| Content Filter | A text pattern: only files whose content matches it are read. |
Output
The Data output returns one item per file read, with its content and details such as its path, name and type. Connect it to an agent, a model or a document store.
Example
A support team wants to answer questions about its product’s documentation:
- Add GitLoader with the repository’s address in Clone URL and a folder in Repository Path.
- In File Filter, enter
*.mdto read only the documentation. - Connect Data to a document store.
- Connect an agent to that store to answer the team’s questions.
Good practices
- Use File Filter to read only the files you need: a large repository has many files.
- Check the branch name: many repositories use
masterinstead ofmain.
Related components
- GitHub Issues: reads the issues of a GitHub repository.
- Repository: manages GitHub repositories.