Git Integration
MINEO's Git integration facilitates seamless version control by allowing users to interact with Git repositories directly within the file explorer.
How to Checkout a Repo
To check out a repository:
- Navigate to the file explorer within your project.
- Click the "+" button and select
Import from git. - Enter the repository's URL and configure your SSH keys if required to ensure secure communication with the Git server. Optionally, you can specify a branch if you wish to update a specific one.
Configuring SSH Keys
Before cloning a private repository, you may need to configure SSH keys.
Step 1: Generate SSH Keys in MINEO
To do this, go to Project settings → Integrations and generate a pair of SSH keys. MINEO shows the generated public key to copy.
An organization administrator can instead generate one key under Organization settings → Integrations. Git operations use the project's own key and fall back to the organization's key when the project has none, so a single organization key can serve every project.
Step 2: Add the Public Key to Your Git Provider
Once generated, you must add the public SSH key to your Git provider account:
For GitLab:
- Copy the public key from MINEO
- Go to GitLab Preferences → SSH Keys (or User Settings → SSH Keys)
- Paste your public key in the "Key" field
- Add a descriptive title
- Set an expiration date (optional but recommended)
- Click Add key
The public key typically starts with ssh-rsa, ssh-ed25519, or similar. Make sure to copy the entire key including the prefix and any trailing comment.
After adding the SSH key to your Git provider, you can use SSH URLs when importing repositories in MINEO:
- Standard SSH:
git@gitlab.com:username/repo.gitorgit@github.com:username/repo.git - SSH with custom port:
ssh://git@gitlab.your-company.com:622/username/repo.git
Using GitHub repositories with MINEO
For write actions or private GitHub repositories, you can use Personal Access Tokens (PAT).
Step 1: Generate a GitHub Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token (classic)
- Give it a descriptive name and select the repo scope for full repository access
- Copy the generated token immediately (you won't be able to see it again)
Step 2: Clone Using the Token in MINEO
When importing a repository in MINEO's file system, use the following URL format:
https://TOKEN@github.com/USERNAME/REPOSITORY.git
Example with a real token format:
https://ghp_abc123DEF456ghi789JKL012mno345pqr678@github.com/your-username/your-repo.git
How to Construct the URL
- Get the standard HTTPS clone URL from GitHub (usually:
https://github.com/username/repo.git) - Simply insert your token followed by
@right afterhttps:// - The pattern is:
https://{token}@github.com/username/repo.git
Using Tokens in Notebooks
You can also use tokens directly in your notebooks: Or use MINEO's project environment variables
# Clone a private repo in a notebook cell
!git clone https://ghp_abc123...@github.com/username/private-repo.git
# Or set as remote origin
!git remote set-url origin https://ghp_abc123...@github.com/username/private-repo.git
Security Notes
- 🔒 Never commit tokens to version control
- 🗑️ Rotate tokens regularly
- 📋 Use environment variables for tokens in production code
- 🔐 Tokens provide full repository access - protect them like passwords
Using GitLab repositories with MINEO
For write actions or private GitLab repositories, you can use Personal Access Tokens (PAT) or Project Access Tokens.
Step 1: Generate a GitLab Personal Access Token
- Go to GitLab Settings → Access Tokens (or User Settings → Access Tokens)
- Enter a name for your token (e.g., "MINEO Integration")
- Set an expiration date (optional but recommended)
- Select the required scopes:
- read_repository - for read-only access
- write_repository - for push access
- api - for full API access (includes read/write)
- Click Create personal access token
- Copy the generated token immediately (you won't be able to see it again)
Step 2: Clone Using the Token in MINEO
When importing a repository in MINEO's file system, use the following URL format:
https://oauth2:TOKEN@gitlab.com/USERNAME/REPOSITORY.git
For self-hosted GitLab instances:
https://oauth2:TOKEN@gitlab.your-company.com/username/repo.git
How to Construct the URL
- Get the standard HTTPS clone URL from GitLab (usually:
https://gitlab.com/username/repo.git) - Insert
oauth2:followed by your token and@right afterhttps:// - The pattern is:
https://oauth2:{token}@gitlab.com/username/repo.git
Alternative: Using Username and Token
GitLab also supports using a username with the token:
https://USERNAME:TOKEN@gitlab.com/username/repo.git
Additional Git Actions
To perform the git actions, you need to navigate to the cloned repository in your file explorer. Once inside the repository, you can perform various Git operations from its context menu to manage and synchronize your code effectively.
-
Update the Repository: To update your local repository with the latest changes from the remote repository, simply press
Pull. This will integrate the new changes, ensuring your code is up to date. Additionally, a--forceoption has been added, which can be selected if you need to override local changes and force synchronization with the remote repository. -
Commit and Push Changes: After modifying files, press
Commit and Pushto confirm and upload your changes to the remote repository in a single action. -
Check the Repository Status: You can check the current status of your repository by pressing
Status. This will display a summary of the changes in your working directory. -
Revert Changes: To undo local changes in files, press
Revert. This allows you to go back if necessary without altering the repository history. -
Resolve Merge Conflict (Use Remote Changes): If you encounter a merge conflict when running
Commit and Push, selecting theMerge(theirs)option will resolve the conflict by discarding your local changes and keeping those from the remote repository. -
Resolve Merge Conflict (Keep Local Changes): If you encounter a merge conflict when running
Commit and Push, selecting theMerge(ours)option will resolve the conflict by keeping your local changes and discarding those from the remote repository.
This integration ensures that developers can manage code changes and maintain synchronization with their team’s work directly from the MINEO environment.