Skip to Content
Native GitClone Repository to Local

Cloning APIGIT Repositories Locally

While the APIGIT portal provides the most intuitive editor and viewer for managing API specifications, you can also work with your repositories locally. As a full-featured Git platform similar to GitHub, APIGIT allows you to clone repositories to your local machine, edit files in your preferred IDE, and push changes back to APIGIT.

Authentication Requirements

APIGIT offers two ways to authenticate Git operations, similar to GitHub: a personal access token over HTTPS, or an SSH key. Username/password authentication is not supported for security reasons.

This page first covers cloning over HTTPS with an access token, then cloning over SSH.

Step 1: Generate an Access Token

If you don’t already have an access token:

  1. Navigate to your Settings → Personal Access Token page
  2. Click the button to generate a new Access Token
  3. Copy and save the token immediately in a secure location, as it will not be displayed again

Tokens created from now on are limited to repository access (Git and the repository API). Tokens created earlier keep their original, broader scope and continue to work. If you would like to replace an older token with a limited one, regenerate it: generate a new token, update your saved credentials and CI settings, and then delete the old one.

Personal Access Token generation page

Step 2: Find the Repository URL

To get the repository clone URL:

  1. Navigate to your repository’s main page
  2. Click the Clone/Download button; the dialog opens on HTTPS
  3. Copy the repository HTTPS address. The line under it reminds you to sign in with your username and a Personal Access Token as the password

Repository clone URL location

Step 3: Clone the Repository

Open a terminal on your computer and use the Git clone command with your username and access token:

$ git clone https://app.apigit.com/apigit/demo.git Cloning into 'demo'... Username for 'https://app.apigit.com': <<YOUR USERNAME HERE>> Password for 'https://app.apigit.com': <<YOUR ACCESS TOKEN HERE>> remote: Enumerating objects: 9, done. remote: Counting objects: 100% (9/9), done. remote: Compressing objects: 100% (4/4), done. remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (9/9), 2.09 KiB | 1.04 MiB/s, done.

After cloning, you can make changes locally using your preferred editor and push them back to APIGIT using standard Git commands.

Clone over SSH

If you prefer not to handle tokens, you can clone and push over SSH with a key pair. SSH access is served from git.apigit.com.

Step 1: Generate an SSH key

If you do not already have a key, create one:

$ ssh-keygen -t ed25519 -C "you@example.com"

Accept the default location (~/.ssh/id_ed25519) and choose a passphrase. This creates a private key (id_ed25519), which you must keep to yourself, and a public key (id_ed25519.pub), which you give to APIGIT.

Step 2: Add the public key to APIGIT

  1. Navigate to your Settings → SSH Keys page
  2. Paste the contents of ~/.ssh/id_ed25519.pub (for example from cat ~/.ssh/id_ed25519.pub) and save it

Step 3: Check your key

Before cloning, check that your key is accepted:

$ ssh -T git@git.apigit.com

The first time you connect, SSH shows the server’s host key fingerprint and asks you to confirm it. Compare it with the table below before answering yes. A successful test prints:

Hi <your username>! You've successfully authenticated to APIGit with the key "<key name>". APIGit does not provide shell access; use this key with git clone, fetch and push.

The missing shell is expected: the SSH endpoint only serves Git.

Step 4: Copy the SSH URL and clone

Open the Clone/Download button on the repository’s main page, switch the dialog to SSH (it has an HTTPS / SSH toggle), and copy that address. Then clone:

$ git clone git@git.apigit.com:apigit/demo.git

Host key fingerprints

These are the host keys of git.apigit.com, on port 22 and port 443 alike. If SSH shows a fingerprint that is not in this table, do not connect.

Key typeSHA256 fingerprint
ED25519SHA256:k3KTtGN+Uq3t8Eekf92Sxxpi9GMPSHcLG04I6/juzo4
ECDSASHA256:R9bhGlwyyg3Wpi1yDFHyu3eeaRM1mQ1Y0bJai8Qx5Vg
RSASHA256:eAZfQAlkiQPaX5R81zBmeR5WMjRvWE7btC5SGTzxqFY

Port 443

If your network blocks outgoing connections on port 22, SSH is also available on port 443. Add this block to ~/.ssh/config:

Host git.apigit.com Hostname git.apigit.com Port 443 User git IdentityFile ~/.ssh/id_ed25519 IdentitiesOnly yes

IdentityFile and IdentitiesOnly make SSH offer only this key. The server allows 3 authentication attempts, so an agent holding many keys can otherwise fail with “Too many authentication failures”.

With it in place, the same commands work unchanged (git clone git@git.apigit.com:apigit/demo.git).

Deploy keys

A deploy key gives a machine, such as a CI runner or a server, access to a single repository without tying it to a personal account. Add one under the repository’s Settings → Deploy Keys. The Allow write access checkbox is unchecked by default, so a new deploy key is read-only; tick it only if the machine must push. The key list shows each key as Read-only or Read & write. A deploy key cannot also be one of your personal SSH keys: generate a separate key pair for each machine.

Last updated on