What is Gitlab's instance domain?


Git Problem Overview

I am trying to test to see if my SSH key was added correctly by following the instructions which are found halfway down the page [here][1].

> To test whether your SSH key was added correctly, run the following > command in your terminal (replacing gitlab.com with your GitLab's > instance domain):

ssh -T git@gitlab.com

However, I have no idea what my "Gitlab's instance domain" is referring to. I have searched other online but I cannot find anything relevant. [1]: https://gitlab.com/help/ssh/README#testing-that-everything-is-set-up-correctly

Git Solutions

Solution 1 - Git

If you're using Gitlab on gitlab.com then the domain is gitlab.com, so you should run  ssh -T [email protected]

Solution 2 - Git

Gitlab can be installed locally so Gitlab instance is what is being run locally. E.g., if one runs Gitlab instance at gitlab.example.net the domain is gitlab.example.net, and the ssh command is ssh -T [email protected].

For Gitlab at gitlab.com the command is ssh -T [email protected].

Solution 3 - Git

This is not a real definition but one section below in that same page you can find the example of the content of a file ~/.ssh/config

# GitLab.com
    Host gitlab.com
    Preferredauthentications publickey
    IdentityFile ~/.ssh/gitlab_com_rsa

# Private GitLab instance
    Host gitlab.company.com
    Preferredauthentications publickey
    IdentityFile ~/.ssh/example_com_rsa

which links the notion of 'instance' to the notions of 'private' and 'company'. Not a foolproof hint, but at least it introduces something clearly distinct from GitLab.com proper.

Basically, if you are a vanilla user, it will be just fine to type ssh -T [email protected].

That instruction is a test before starting the dance. Worked for me also down the line, when I cloned the repository I was interested in with a git clone [email protected]:<myreponame>.git.

Solution 4 - Git

If your git (or gitlab) repo is something like https://a.b.com/abc/abcd then first, you clone using ssh (after adding your public ssh key) to repo, and then test using ssh -T [email protected]. That's it!!


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRiley FinnView Question on Stackoverflow
Solution 1 - GitLakshitha WisumperumaView Answer on Stackoverflow
Solution 2 - GitphdView Answer on Stackoverflow
Solution 3 - GitXavierStuvwView Answer on Stackoverflow
Solution 4 - GitUddhav P. GautamView Answer on Stackoverflow