Created
December 5, 2023 02:52
-
-
Save bhubr/51914d4e1030fea4e17a2b8980d9a7ec to your computer and use it in GitHub Desktop.
Connect to GitLab with custom SSH key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assuming I put this in `~/.ssh/config`: | |
``` | |
Host gitlab-public | |
HostName gitlab.com | |
User gluser | |
ForwardAgent yes | |
IdentityFile /Users/myuser/.ssh/id_ed25519_gitlab_public | |
``` | |
I can set the GitLab remote like so: | |
``` | |
git remote add gitlab git@gitlab-public:gluser/my-sample-project.git | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment