git fetch new revisions.
If you’re not familiar with Sourcebot connections, please read that overview first.
Getting Started
Let’s assume we have arepos directory located at $(PWD) with a collection of git repositories:
1
Mount a volume
We need to mount a docker volume to the
repos directory so Sourcebot can read it’s contents. Sourcebot will not write to local repositories, so we can mount a separate read-only volume:2
Create a connection
We can now create a new git connection, specifying local paths with the Sourcebot will expand this glob pattern into paths
file:// prefix. Glob patterns are supported. For example:/repos/repo_1, /repos/repo_2, etc. and index all valid git repositories.Examples
Sync individual repo
Sync individual repo
Sync multiple repos using glob patterns
Sync multiple repos using glob patterns
Optimizing git operations
Sourcebot performs a number of operations that require traversing a repository’s entire commit history (e.g.,git rev-list --count HEAD). These operations can be slow in repositories with a large number of commits.
Typically, a commit graph is generated to speed up these operations (see #791). However, since local repositories are treated as read-only, Sourcebot will not generate a commit graph for them.
A commit graph can be manually generated by running the following command in the repository’s root directory:
--write-commit-graph:
Schema reference
Reference
Reference

