Prerequisites:
- Download git-scm
- GitLab server
- Open the C:/user/your-user/.ssh/ and create the SSH key via git-bash:
>> ssh-keygen.exe -t rsa -b 4096
- Add the public key to your GitLab account
4.1 Enter your GitLab website
4.2 Click on your profile, then ‘Setting’ and after that select ‘SSH-Keys’
4.3 Follow the instructions of GitLab for adding a new key - Create a ‘config‘ file (without extension) in C:/user/your-user/.ssh/ and add the following content:
Host sample_1 user git hostname git.domain.com port 22 identityfile ~/.ssh/generated-private-key-file_1 # For multiple ssh-key you can add more than one host Host sample_2 user git hostname git.domain.com port 22 identityfile ~/.ssh/generated-private-key-file_2
- Test it with the git-bash console:
git clone git@sample:project.git
- [Optional] If the key could not be found try to add the following argument to your environment variables:
Name: HOME Value: %USERPROFILE%