Connect Your Repository
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:
Paste 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:
Private SSH repositories:
Private HTTPS with credentials (not recommended):
💡 Use SSH for private repos. Embedding credentials in URLs is less secure and harder to manage.
Select branches
Using the Branch input field, select the branches you would like to track in Valohai. This setting requires a comma-separated list of branch names or patterns.
Selected branch patterns are compared against the existing branches using Shell Patterns.
With each Fetch repository action, Valohai will fetch the latest commit from each of the selected branches.
💡 To fetch tags, add
tag/prefix to your tag name, and as such add it to the Branch input field.
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
💡 If you just connected the repository, no commits will appear in Valohai until you fetch it once.
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?
