Generating an SSH Key Pair
If you don't already have an SSH key, generate one:
On macOS / Linux
ssh-keygen -t ed25519 -C "This email address is being protected from spambots. You need JavaScript enabled to view it. "
Press Enter to accept the default file location. Optionally set a passphrase for additional security.
On Windows
Open Git Bash or PowerShell and run the same command:
ssh-keygen -t ed25519 -C "This email address is being protected from spambots. You need JavaScript enabled to view it. "
Adding Your SSH Key to MokoGIT
- Copy your public key to the clipboard:
# macOS cat ~/.ssh/id_ed25519.pub | pbcopy # Linux cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Windows (PowerShell) Get-Content ~/.ssh/id_ed25519.pub | Set-Clipboard - In MokoGIT, go to Settings → SSH / GPG Keys.
- Click Add Key.
- Enter a descriptive Key Name (e.g., "Work Laptop").
- Paste your public key into the Content field.
- Click Add Key.
Testing Your SSH Connection
ssh -T git@your-mokogit-url
If successful, you'll see a message like: Hi username! You've successfully authenticated.
Cloning via SSH
Once your key is added, clone repositories using the SSH URL:
git clone git@your-mokogit-url:owner/repo-name.git
HTTPS with Personal Access Tokens
If you prefer HTTPS over SSH, you can authenticate using a personal access token instead of your password:
- Generate a token under Settings → Applications (see User Settings).
- When prompted for a password during
git push, enter your token instead. - To avoid re-entering it, configure Git's credential helper:
git config --global credential.helper store
Troubleshooting
- Permission denied (publickey) — Ensure your public key is added to MokoGIT and the private key is loaded in your SSH agent (
ssh-add ~/.ssh/id_ed25519). - Wrong key used — If you have multiple keys, create an SSH config entry:
Host mokogit HostName your-mokogit-url User git IdentityFile ~/.ssh/id_ed25519
