Tutorial: Connect Git Repositories
Beginner — 5 minutes
Learn how to connect your Git provider (GitHub, GitLab, or Gitee) to AgentsMesh so your AI agents can work on your code repositories.
Prerequisites
Before starting, make sure you have:
- An AgentsMesh account with a Runner connected (see Runner Setup tutorial)
- A GitHub, GitLab, or Gitee account with repositories you want to use
1
Open Git Settings
Navigate to Settings → Personal → Git Settings. This is where you manage all your Git provider connections.
2
Connect GitHub
For GitHub, you can use a Personal Access Token (works for everyone) or OAuth (only if you signed up with GitHub):
- Personal Access Token: In GitHub, go to Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Generate a token with Contents (Read-only) and Metadata (Read-only) permissions for your repositories
- In AgentsMesh, click Add GitHub Provider and paste your token
- Your repositories will appear in Settings → Repositories
If you signed up for AgentsMesh with your GitHub account, you can also use the Connect GitHub button for OAuth — your account is already linked. Email sign-up users must use a Personal Access Token.
3
Connect GitLab (Personal Access Token)
For GitLab, use a Personal Access Token:
- In GitLab, go to Settings → Access Tokens
- Create a new token with api and read_repository scopes
- Back in AgentsMesh, click Add GitLab Provider
- Paste your token and enter your GitLab URL
Self-hosted GitLab is fully supported. Enter the full URL of your instance (e.g., https://gitlab.yourcompany.com).
4
Connect Gitee (Personal Access Token)
For Gitee, use a Personal Access Token:
- In Gitee, go to Settings → Personal Access Tokens
- Create a new token with projects scope
- Back in AgentsMesh, click Add Gitee Provider and paste your token
5
Import Repositories
After connecting a provider, import the repositories you need:
- Go to Settings → Repositories
- Click Add Repository and select your provider
- Browse or search for repositories to import
- Selected repositories become available when creating Pods
6
Configure SSH Keys (Optional)
If your repositories use SSH access, configure SSH keys on the Runner:
- Generate an SSH key pair on your Runner machine
- Add the public key to your Git provider
- The Runner will use the SSH key when cloning repositories
Docker Runners: Mount your SSH keys as a read-only volume: -v ~/.ssh:/root/.ssh:ro
7
Verify by Creating a Pod
Test your setup by creating a Pod with a linked repository:
- Go to Workspace and click New Pod
- Select an AI agent and your Runner
- Choose one of your imported repositories
- The Pod should start with the repository cloned into a worktree
Each Pod gets its own Git worktree, so multiple Pods can work on the same repository without conflicts.
What's Next?
Your repositories are connected. Continue exploring: