GitHub For Beginners
Introduction
You are here because you know what are git and GitHub so I am not gonna bombard you with information that I assume you already know, so in this article, I will show you how you can connect Your GitHub account through ssh. and also this installation process is only for Linux users if you are not one of us please leave.
Installation
Open Terminal.
Paste the text below.
$ sudo apt install git
Paste the text below, substituting it in your GitHub email address.
$ ssh-keygen -t ed25519 -C "your_email@example.com"
Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
This creates a new SSH key, using the provided email as a label.
> Generating public/private ALGORITHM key pair.
When you're prompted to "Enter a file in which to save the key", you can press Enter to accept the default file location. Please note that if you created SSH keys previously, ssh-keygen may ask you to rewrite another key, in which case we recommend creating a custom-named SSH key. To do so, type the default file location and replace id_ssh_keyname with your custom key name.
> Enter a file in which to save the key (/home/user/.ssh/ALGORITHM):[Press enter]
At the prompt, type a secure passphrase.
> Enter passphrase (empty for no passphrase): [Type a passphrase] > Enter same passphrase again: [Type passphrase again]
Adding your SSH key to the ssh-agent
Before adding a new SSH key to the ssh-agent to manage your keys, you should have checked for existing SSH keys and generated a new SSH key.
Start the ssh-agent in the background.
$ eval $(ssh-agent -s) > Agent pid 59566
Depending on your environment, you may need to use a different command. For example, you may need to use root access by running
sudo -s -H
before starting the ssh-agent, or you may need to useexec ssh-agent bash
orexec ssh-agent zsh
to run the ssh-agent.Add your SSH private key to the ssh-agent. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_ed25519 in the command with the name of your private key file.
$ ssh-add ~/.ssh/id_ed25519
Add the SSH key to your account on GitHub.
Now you can clone your git repo using git clone
push something using git push
stuff like that.
Subscribe to my newsletter
Read articles from Sayon directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by