Git SSH with GitLab self-managed instances

Since GitLab Community Edition is open source, large projects like CMake may host their own self-managed GitLab instance. To make merge requests to such projects, one can configure Git SSH. For this example, we use Kitware’s CMake GitLab instance.

First, create an account on the self-managed GitLab instance and fork the desired repo. This will be available like

git clone

To git push using SSH, type:

git config --global url."ssh://".pushInsteadOf

Generate an SSH key–don’t reuse SSH keys between sites.

ssh-keygen -t ed25519 -f ~/.ssh/kitware

Go to the GitLab SSH Key page and add the contents of ~/.ssh/

Add to ~/.ssh/config:

  User git
  IdentityFile ~/.ssh/kitware

Now checkout a new branch, make your changes according to project guidelines and submit a merge request.