50.1k views
2 votes
How to connect to GitHub repository from terminal using SSH?

User Pkumarn
by
7.4k points

1 Answer

2 votes

Final answer:

To connect to a GitHub repository from the terminal using SSH, generate an SSH key pair, add the public key to your GitHub account, clone the repository using the SSH URL, and enter your GitHub credentials.

Step-by-step explanation:

To connect to a GitHub repository from the terminal using SSH, follow these steps:

Generate an SSH key pair on your local machine using the ssh-keygen command.

Add the public key to your GitHub account by copying the contents of the .pub file and adding it in your GitHub settings.

Clone the repository using the SSH URL provided by GitHub. Use the git clone command followed by the SSH URL.

Enter your GitHub credentials if prompted.

After completing these steps, you will be able to connect to the GitHub repository from the terminal using SSH.

User Oldman
by
7.7k points