Skip to content

Instantly share code, notes, and snippets.

@EddyVinck
Last active July 18, 2019 13:16
Show Gist options
  • Save EddyVinck/b7052c16858ae636558085faa788b8ce to your computer and use it in GitHub Desktop.
Save EddyVinck/b7052c16858ae636558085faa788b8ce to your computer and use it in GitHub Desktop.
Setting up ssh for Gitlab on Windows

After installing Git and in Git Bash...

$ ssh-keygen -t rsa

You can change the default name or location if you prefer

Copy the key to your GitLab

$ cat ~/.ssh/my_key.pub | xclip

and test it

$ ssh -T -i ~/.ssh/my_key git@gitlab.com

Create a config

$ touch ~/.ssh/config

Open that file in your editor and add the following

host gitlab.com
  HostName gitlab.com
  IdentityFile ~/.ssh/my_key
  User git

Make a folder for your project and go to the folder

Clone the repository

$ 'git clone git@gitlab.com:project/project.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment