Prerequisites: -
-
Git must be installed in your device. To see if you have git
installed use the command:
git -v
- You must have already configured your credentials (i.e. your email and username for git). If you haven't done so yet, use the following commands to set up your email and username: -
for email: - git config --global user.email "youremail@yourdomain.com"
for username: - git config --global user.name "Your Name"
If you have those done, let's move forward.
- Generating the SSH key: -
copy the command:
ssh-keygen -t ed25519 -C "your_email@example.com"
and paste it in your (git bash) terminal.
replace the dummy email with your own (preferably your GitHub account)If you wish to enter a pass phrase you can do so, But for this tutorial
we will just keep it empty. Hit enter until you are able to enter a new
command in your terminal.
- Copying the SSH key: -
- Use this command in your terminal:
clip < ~/.ssh/id_ed25519.pub
to copy your SSH key.
- Adding SSH key to your GitHub account: -
Click on your profile (On the Top right) and open settings.
Click on "π SSh and GPG keys" on the left side under the access
section.Click on "New SSH key"
Give it a title (Anything you want)
Paste your SSH key in "key" input field.
Finally, click on "Add SSH key"
So, did you find it simple?
if you would like to learn more about the ssh key follow the link below to the official page of GitHub: -
[ https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent ]
Top comments (0)