docs/ai_builder/features/connect_to_git_providers.md
import reflex as rx
Connect a Git repository at the project level so Reflex Build can clone the code before the agent starts working. The current Repos interface supports GitHub, GitLab, Bitbucket, Azure DevOps, self-hosted Git servers, and other HTTPS Git remotes.
Use this workflow to start from an existing repository by providing its URL and a personal access token. To create and synchronize a GitHub repository for an individual Builder app through the reflex-build GitHub App, see Connecting to GitHub.
rx.image(
src="https://web.reflex-assets.dev/docs-preview/ai-builder/platform/repos.webp",
alt="Connected project repositories from several Git providers",
class_name="rounded-md h-auto mb-4",
border=f"0.81px solid {rx.color('slate', 5)}",
)
Create a credential supported by your Git provider and grant it only the repository access required by this connection. The Repos page provides provider-specific instructions. For example, use a fine-grained GitHub token limited to the selected repository with Contents: Read and write.
Use the repository's HTTPS clone URL:
https://gitlab.com/example/team-app.git
The repository is cloned before the agent starts, so the first prompt can work from the existing files rather than generating an unrelated app.
Repository connections are controlled by project permissions. If Connect Repository is unavailable, ask a project admin to check your role and plan.