Connect Your Repository
Link a Git repository to your Valohai project
Connect your Git repository to enable version-controlled ML experiments. Valohai will fetch your code at the start of each execution and automatically track which commit was used.
Before You Start
Make sure you have:
A Valohai project (create one from the dashboard)
A Git repository with your ML code
(For private repos) SSH access configured
Connect a Public Repository
Public repositories are the fastest way to get started—no authentication needed.
Navigate to your project settings:
Open your Valohai project
Go to Settings → Repository
Enter your repository URL in HTTPS format:
https://github.com/username/repository.gitClick Save
Valohai will fetch your repository immediately. You'll see the available commits in the execution creation dialog.
Connect a Private Repository
Private repositories require SSH authentication. Valohai uses deploy keys for secure, read-only access.
Generate SSH Key in Valohai
The easiest method is to let Valohai generate the key pair:
Go to Settings → Repository
Click Generate SSH Key
Download or copy both keys:
Public key (
.pub) – Add this to your Git providerPrivate key (
.pem) – Paste this into Valohai
Add Public Key to Your Git Provider
The exact steps depend on your provider:
Add Private Key to Valohai
Back in Valohai's repository settings:
Enter your SSH repository URL:
[email protected]:username/repository.gitPaste the entire private key into the SSH private key field
The key should start with
-----BEGIN RSA PRIVATE KEY-----Click Save
Valohai will attempt to fetch the repository. If successful, you'll see your commits.
Repository URL Formats
Use the correct URL format for your connection type:
Public HTTPS repositories:
https://github.com/username/repository.git
https://gitlab.com/username/repository.gitPrivate SSH repositories:
[email protected]:username/repository.git
[email protected]:username/repository.git
[email protected]:v3/org/project/repository
[email protected]:username/repository.gitPrivate HTTPS with credentials (not recommended):
git+https://username:[email protected]/username/repository.git💡 Use SSH for private repos. Embedding credentials in URLs is less secure and harder to manage.
Verify the Connection
After connecting, verify everything works:
Go to Executions → Create Execution
Check the Commit dropdown—you should see your commits listed
If commits are missing, click Fetch Repository in settings
Fetch New Commits
Valohai caches your repository state. After pushing new commits, manually fetch to update:
Go to Settings → Repository
Click Fetch Repository
New commits appear immediately in execution dialogs
Automate fetching with webhooks:
Troubleshooting
"Repository not found" or "Permission denied"
Double-check the repository URL format
Ensure the SSH public key is added to your Git provider
Verify the private key was pasted completely (including header/footer)
"Fetch timeout" or "Slow fetches"
Your repository may be too large (>100 MB compressed)
Use
.vhignoreto exclude unnecessary filesConsider using Git submodules for large dependencies
"Old code is running"
You need to fetch after pushing new commits
Click Fetch Repository in project settings
Consider setting up webhooks for automatic fetching
"Can't see my private key field"
Make sure you're using the SSH URL format (
git@...)The private key field only appears for SSH URLs
Next Steps
Configure your repository:
Use .vhignore to exclude large files from workers
Manage Commits to hide old branches
Advanced workflows:
Access Multiple Repositories with Git submodules
Clone Additional Repos during execution
Last updated
Was this helpful?
