Well, for self hosted you would configure the instance URL yourself and you should know it. I guess that for instance hosted by gitlab you’d receive a weblink from them.
So it is just the webaddress of your gitlab, whether you configured it for a self hosted instance, or one you received from Gitlab to visit your instance.
grove’s reply might not seem very kind, but he/she is kinda correct that there isn’t much to explain about this.
thanks @bartj
well I received an invitation from my future boss, signed-up, set everything up and want to confirm if I can connect correctly.
in the docs it says that it shall look like this: git@gitlab.example.com
in your stackoverflow link it says it should look like this: gitlab.com
apparently I’m not getting something basic, but is there a way to get my instance URL for sure? like going to my dashboard, or settings and copying it from somewhere?
so I had to generate a new ssh key to make it work, but for all the others stumbling across the problem this thread was about:
1.Go to your dashboard
2.Copy the URL
3.Your Gitlab Instance URL is git@dashboardURL
If your future boss uses the SaaS offering on GitLab.com, the instance URL is gitlab.com, operated and managed by the GitLab infrastructure team.
If the company instead uses a self-managed setup, the domain where the webserver provides the GitLab UI cannot be gitlab.com or any sub domain. Instead, you often see something like
gitlab.companydomain.com
git.internaldomain.com
Or similar. From your browser’s address bar, you’ll extract https://gitlab.companydomain.com/ whereas the instance URL is gitlab.companydomain.com then.
Depending on the desired way to clone from the Git server in GitLab, you’ll either use SSH or HTTPS as transport. In your example, this is SSH using the git username @ the instance URL. Next to the URL, the clone command also needs the namespace and project with the .git suffix.
Tip: There’s also an easier way to get the clone URL from the UI in the web interface. Navigate into the project repository overview and click on the right side on Clone.
A click on the copy icon copies the text into your clip board, and depending on your OS, you can insert it into the terminal then. On macOS, use cmd+v.
On the “Clone with SSH” box, I have a question? Breaking down the url in there:
git " I know this is the user"
@ gitlab.com → This comes from hostname on a deployment config? Is there any other way configure this?
I’ve taken the screenshot from a project on GitLab.com SaaS, hence the gitlab.com URL. If you are running a self-managed instance, this will be the instance URL configured as external_url in your gitlab.rb settings. More in the documentation.
Thanks Michael. I had run across that and could have sworn I had it set. It might have been an issue with the envvar that was being used. So I set it directly in the gitlab.rb file.
This seemed to cause a few other issues (too many redirects so I will play with the reverse proxy…).
However, looking at the logs this seems like it worked.
I go bit by this too. I kept trying things with my user name in it. The answer for most would be just git@gitlab.com. I suppose it is different if you have set up a company account with gitlab, but I just have a personal account here.
Bottom line: the help docs on ssh keys could explain this better. Nothing there defines ‘instance url’ so I was left wondering.
@dnsmichi, thanks for the quick reply. Might I suggest something like this:
Open a terminal and run this command:
ssh -T <instance url>
For most [or free or general?] users, the <instance url> is simply, git@gitlab.com, so you would run:
ssh -T git@gitlab.com
If you have a [domain-specific instance not sure what the best wording would be here I am new to gitlab] and your [domain name is] example.com, you would run:
I agree with @dnsmichi , the documentation is clear (and the part before the @ (and the @ itself) is not part of any url I’ve ever seen), so where were you trying to put in your username? Maybe it should just be made clear that is not a part of the instance url.
Although I never use -l (the first time I saw someone do it, I actually had to ask what it meant) @dnsmichi 's idea to do so in the documentation sounds like it might eliminate a lot of this confusion (and I doubt it’s possible to eliminate all, even with documentation that says “do this”, you get people asking “what to do?”).
I ran into the same issue today. I simply have a free personal gitlab account (to host repositories on gitlab.com) and didn’t understand what was the instance url.
It was clear to me that only the part after git@ needed to be changed but I didn’t know what to change it to. What is not clear is the definition of instance url.
After reading this thread, I understood that in my case the instance url was simply: gitlab.com.