DEV Community

alfanfauzy
alfanfauzy

Posted on • Edited on

How to clone repo from Github

In the last month, my office migrate the Repositories from Gitlab to Github. I try to write this article for sharing and as my documentation.

Disclaimer : I have account in Github before and I use mac Terminal

Step 1

For the first step, I am install Github via Terminal.

brew install gh
Enter fullscreen mode Exit fullscreen mode

wait the process install until see the finished installation.

Step 2

Second step, authenticated with Github Account.

gh auth login
Enter fullscreen mode Exit fullscreen mode

follow the instruction until authenticate with Github Account

Screenshoot gh auth login

Step 3

Third step, create ssh-keygen to set to Github Account so we can clone the repo.

ssh-keygen
Enter fullscreen mode Exit fullscreen mode

The file will create in folder /Users/yourname/.ssh/. From this step will be generate 2 file id_rsa and id_rsa.pub

Copy text file from id_rsa.pub with command

pbcopy < ~/.ssh/id_rsa.pub
Enter fullscreen mode Exit fullscreen mode

Paste text info your account Github.

Last

After following all step, in the last step. I just clone the repo with command

git clone <repo link>
Enter fullscreen mode Exit fullscreen mode

But, if you doing this in new computer which is the github/gitlab account didn't setting before. Check with

sss -T git@gitlab.com
Enter fullscreen mode Exit fullscreen mode

Source

Top comments (0)