How to clone private Repo
August 10, 2025Less than 1 minute
Background
I was granted as a manager on a private github repo, the first task is how to clone the repo.
Solution
Using ssh to clone the repo.
Step 1: Generate SSH Key
Run the following command to generate sshssh-keygen -t ed25519 -C "your_email@domain.com"
The ssh key will be saved to ~/.ssh/id_ed25519
as default setting, please remember your passphrase.
Step 2: Setup the SSK Key in Github
Settings
-> SSH and CPG keys
-> New SSH Key
Copy the content in ~/.ssh/id_ed25519.pub
to Key.
Step 3: Clone repo
Copy the ssh repo address from the web portal. and then run the command belowgit clone git@github.com:user_name/repo_name.git
Enter your passphase, finally you will get the repo.