Last active
April 15, 2019 08:31
-
-
Save CedricL46/595dd61c022b455ba5f344dfb71eb54d to your computer and use it in GitHub Desktop.
See full tutorial here : https://cedricleruth.com/how-to-migrate-an-svn-repository-to-git-and-your-company-gitlab/
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
#Up to date doc can be found on https://gitlab.com/help/ssh/README#generating-a-new-ssh-key-pair | |
#First configure your local git configuration so it can communicate with your gitlab server : | |
# If you're on windows install git bash for windows if not install git | |
# This time i'm on windows so : | |
#Open a git bash command terminal (right click into any folder + git bash here) | |
#Generate a new ED25519 SSH key pair | |
#(as a best practice we should always prefer ED25519 to old rsa format) | |
#(as a best practice dont forget to add a strong passkey and save it in your keypass) | |
ssh-keygen -t ed25519 -C "YourEmail@YOUR_COMPANY.com" | |
#Clip the generated public key to copy it into your gitlab console | |
cat ~/.ssh/id_ed25519.pub | clip | |
#Open the gitlab console and Paste the clipped public key into your (Profile Menu > Settings > SSH Key > Key) + Add it | |
#in your git bash console run : | |
eval $(ssh-agent -s) | |
ssh-add ~/.ssh/id_ed25519 | |
#specify which ssh key to use for your gitlab | |
vi ~/.ssh/config | |
# Company GitLab instance (ensure gitlab.YOUR_COMPANY.com is your gitlab url) | |
Host gitlab.YOUR_COMPANY.com | |
Preferredauthentications publickey | |
IdentityFile ~/.ssh/id_ed25519 | |
#:wq(to save and quit vi) | |
#To verify that your local git can communicate with the gitlab server in ssh run : | |
#(ensure your gitlab url is gitlab.YOUR_COMPANY.com) | |
ssh -T git@gitlab.YOUR_COMPANY.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment