0% found this document useful (0 votes)
6 views6 pages

Github Config: How To Generate An SSH Key and Add It To Github

This document provides a step-by-step guide on generating an SSH key and adding it to Github, as well as making your first code deposit on the platform. It includes prerequisites, detailed instructions for each step, and a reminder of essential Git commands. The tutorial is aimed at users with a Github account and Git installed on their machines.

Uploaded by

agondanoumarius3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Github Config: How To Generate An SSH Key and Add It To Github

This document provides a step-by-step guide on generating an SSH key and adding it to Github, as well as making your first code deposit on the platform. It includes prerequisites, detailed instructions for each step, and a reminder of essential Git commands. The tutorial is aimed at users with a Github account and Git installed on their machines.

Uploaded by

agondanoumarius3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Github Config

Install Git Bash if you are on Windows Machine


Use this link

Git - Downloads
https://git-scm.com/downloads

Open Git Bash Terminal or Linux Terminal

How to Generate an SSH Key and Add it to


Github
Github is a great platform for hosting and collaborating on code repositories. In this
tutorial, we will guide you through the process of generating an SSH key and adding it
to Github using RSA.

Prerequisites
Before starting, you should have:

A Github account

Git installed on your machine

Step 1: Generate RSA Key Pair


1. Open Git Bash or Terminal on your machine.

2. Type the following command to generate an RSA key pair:

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Replace "your_email@example.com" with your actual email address.

Github Config 1
3. You will be prompted to enter a file name to save the key pair. Press Enter to accept
the default file name and location.

4. You will be prompted to enter a passphrase for the key pair. Choose a strong
passphrase and remember it.

5. The key pair will be generated and saved to your machine.

Step 2: Add the Public Key to Github


1. Log in to your Github account and go to your account settings.

2. Click on "SSH and GPG keys" from the left menu.

3. Click on "New SSH Key".

4. Give your key a title that helps you identify it.

5. Copy the contents of your public key file into the "Key" field. You can do this by
typing the following command:

cat ~/.ssh/id_rsa.pub

This will print the contents of your public key file to the terminal. Select and copy the
entire output.

6. Paste the contents of your public key into the "Key" field on Github.

7. Click "Add SSH Key".

Step 3: Verify the Connection


1. Open Git Bash or Terminal on your machine.

2. Type the following command to test the connection:

ssh -T git@github.com

You will be prompted to confirm the connection. Type "yes" to confirm.

Github Config 2
3. If the connection is successful, you should see a message that says "Hi username!
You've successfully authenticated, but Github does not provide shell access."

Congratulations! You have now generated an SSH key and added it to Github using
RSA.

Reminder of Some Git Commands and Their Roles


git init : Initializes a new Git repository.

git clone : Copies a remote repository to your local machine.

git add : Adds changes to the staging area.

git commit : Commits changes to the repository with a message.

git push : Pushes changes to the remote repository.

git pull : Pulls changes from the remote repository.

git status : Shows the status of the repository.

git log : Shows the commit history of the repository.

git branch : Shows the current branch and lists all branches.

git checkout : Switches branches or restores files.

git merge : Merges changes from one branch into another.

How to Make Your First Code Deposit on


Github
Github is a great platform for hosting and collaborating on code repositories. In this
tutorial, we will guide you through the process of making your first code deposit on
Github.

Prerequisites
Before starting, you should have:

A Github account

Git installed on your machine

Github Config 3
A code repository that you want to deposit on Github

Step 1: Create a New Repository on Github


1. Log in to your Github account and click on the "+" sign in the top right corner.

2. Select "New repository" from the dropdown menu.

3. Give your repository a name and description.

4. Choose whether you want your repository to be public or private.

5. Select "Create repository".

Step 2: Clone the Repository to Your Local Machine


1. Copy the repository's URL from Github.

2. Open Git Bash or Terminal on your machine.

3. Type the following command to clone the repository to your local machine:

git clone <repository_URL>

Replace <repository_URL> with the URL you copied from Github.

Step 3: Add Your Code to the Local Repository


1. Navigate to the cloned repository on your local machine.

2. Add your code to the repository.

git add .

This command will add all the files in the current directory to the repository.

3. Commit your changes.

git commit -m "Your commit message here"

Github Config 4
Replace "Your commit message here" with a short description of the changes you
made.

Step 4: Push Your Changes to Github


1. Push your changes to Github.

git push origin master

This command will push your changes to the master branch of the repository on
Github.

2. Enter your Github username and password when prompted.

Step 5: Verify Your Changes on Github


1. Go to your repository on Github.

2. Verify that your changes have been deposited successfully.

Congratulations! You have now made your first code deposit on Github.

Reminder of Some Git Commands and Their Roles


git init : Initializes a new Git repository.

git clone : Copies a remote repository to your local machine.

git add : Adds changes to the staging area.

git commit : Commits changes to the repository with a message.

git push : Pushes changes to the remote repository.

git pull : Pulls changes from the remote repository.

git status : Shows the status of the repository.

git log : Shows the commit history of the repository.

git branch : Shows the current branch and lists all branches.

git checkout : Switches branches or restores files.

Github Config 5
git merge : Merges changes from one branch into another.

By @Freddy AGBONA

Site en maintenance
Ce site subit en ce moment des modifications majeures. Il sera disponible bientôt !
https://fredthedev.com

Github Config 6

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy