How to clone project from GitLab using SSH key?

Why we need to clone project?

This is because we want to get the syncronise coding with the other programmer. Basically, GitLab has their own basic command but to make our work become easier, we will use the tools which is "Sourcetree".





Before we start cloning the project, we must generate SSH key using command prompt. Below are the steps to generate SSH key :

1) Open your Command Prompt (Windows) or Terminal (Mac/Linux) or Git Bash.

2) Paste the command below and use your Git email address 
ssh-keygen -t rsa -b 4096 -C “your_email@barracudacampus.com”
This command is use to generate new ssh key by using the provided email.

3) When you’re prompted to “Enter a file in which to save the key,” press Enter. This will accept the default file location.
Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]
4) At the prompt, type a secure passphrase. For more information, see “Working with SSH key passphrases”.
Enter passphrase (empty for no passphrase): [Type a passphrase]Enter same passphrase again: [Type passphrase again]



After generate the new SSH key, now you can clone your project. Follow the steps below :

1) Add your new SSH key in Sourcetree: Tools > Add SSH keys

2) Add SSH key in GitLab: Profile > Setting > SSH keys > Paste SSH keys

3) Open GitLab Project Select Project 

4) On the right side click Clone > Copy with SSH

5) Open Sourcetree click File > Clone/New > Paste in Source Path/URL

6) Set destination path Browse C:\xampp\htdocs\smap

7) Click Clone




Comments

Popular posts from this blog

What is getnada?