Dung (Donny) Nguyen

Senior Software Engineer

Clone Git repository using SSH

To clone a Git repository using SSH, follow these steps:

πŸ› οΈ Prerequisites

πŸ”‘ Step 1: Generate SSH Key (if not already done)

ssh-keygen -t ed25519 -C "your_email@example.com"

This creates a key pair in ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub.

πŸ“€ Step 2: Add SSH Key to Git Host

πŸ“¦ Step 3: Clone the Repository

Use the SSH URL provided by your Git host. It typically looks like:

git@github.com:username/repository.git

Run:

git clone git@github.com:username/repository.git

πŸ§ͺ Step 4: Test SSH Connection (Optional)

ssh -T git@github.com

You should see a message like:

Hi username! You've successfully authenticated...