Local Git repositories
This feature is only supported when self-hosting.
Sourcebot can sync code from generic git repositories stored in a local directory. This can be helpful in scenarios where you already have a large number of repos already checked out. Local repositories are treated as read-only, meaing Sourcebot will not git fetch
new revisions.
Getting Started
Only folders containing git repositories at their root and have a remote.origin.url
set in their git config are supported at this time. All other folders will be skipped.
Let’s assume we have a repos
directory located at $(PWD)
with a collection of git repositories:
To get Sourcebot to index these repositories:
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 seperate read-only volume:
Create a connection
We can now create a new git connection, specifying local paths with the file://
prefix. Glob patterns are supported. For example:
Sourcebot will expand this glob pattern into paths /repos/repo_1
, /repos/repo_2
, etc. and index all valid git repositories.