Whether you have a repository of CSV files, command line scripts, or a custom Mitto plugin, cloning a private Github repo onto your Mitto instance requires little setup.

Whether you have a repository of CSV files, command line scripts, or a custom Mitto plugin, cloning a private Github repo onto your Mitto will require a little setup.
We recommend cloning the repo over SSH using a deploy key. To do this, you will need to upload your SSH key to the Mitto filesystem, and then move the key to Mitto's .ssh
directory.
Create an SSH Key
If you haven't already create a public and private SSH key pair.
- Create an SSH key pair using
ssh-keygen
.
Documentation at github.com - The public SSH key needs to be added to the Github repo you wish to clone in Mitto. See the Deploy Keys section of this Github documentation: https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys. You do not need to check Allow write access as Mitto will only be pulling your repo.
- The private SSH key needs to be saved on Mitto. You can drop it into the file manager directly.
Create a CLI Job to Add the Key to Mitto
The SSH key needs to be moved into /var/mitto/etc/.ssh/
and have the correct permissions chmod 0400 /var/mitto/etc/.ssh/{key}
.
Create the following shell script and upload it via the file manager:
#!/bin/bash
mkdir -p /var/mitto/etc/.ssh/
mv /var/mitto/data/$1 /var/mitto/etc/.ssh/
chmod 0400 /var/mitto/etc/.ssh/$1
In the example below the SSH key is called single_repo_key
and the shell script called add-deploy-key.sh

Create and run a Mitto command line job running the shell script above with your deploy key as an argument: bash /var/mitto/data/add-deploy-key.sh single_repo_key
You will only need to run this job once.
Clone the Github Repository
Create another Mitto command line job to clone the repo into /var/mitto/data
Use the command git clone git@github.com:{teamname}/{repo}.git /var/mitto/data/{repo}
, and add an environment variable GIT_SSH_COMMAND
with the value ssh -o \"StrictHostKeyChecking no\" -i /var/mitto/etc/.ssh/single_repo_key
Click Done
to save the job and then run it.

This should clone your git repo into /var/mitto/data
. NOTE: in the current version of Mitto (2.8) your repo will be hidden in the Mitto file manager UI.