GitHub For Beginners

SayonSayon
2 min read

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

  1. Open Terminal.

  2. Paste the text below.

     $ sudo apt install git
    
  3. 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]
    
  4. 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.

  1. 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 use exec ssh-agent bash or exec ssh-agent zsh to run the ssh-agent.

  2. 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
    
  3. 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.

0
Subscribe to my newsletter

Read articles from Sayon directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sayon
Sayon