Skip to content

Instantly share code, notes, and snippets.

@badhonhitech
Created October 3, 2020 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badhonhitech/2c59e47aeb70d383c908991dc8430b8d to your computer and use it in GitHub Desktop.
Save badhonhitech/2c59e47aeb70d383c908991dc8430b8d to your computer and use it in GitHub Desktop.
Day 9
#!/bin/bash
# Part 1
# To Install latest Git using PPA run this command:
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
# To check Git version run this command:
git --version
# To Configure Git run this command:
sudo git config --global user.name "TypeYourName"
sudo git config --global user.email "TypeYourEmail"
# To check Git configuration settings run this command:
git config --list
# Part 2
# Checking for existing SSH keys
ls -al ~/.ssh
# If you do not see any file name "id_rsa.pub" into a list that means your Ubuntu do not have existing SSH key.
# if you see any file name "id_rsa.pub" into a list that means you Ubuntu have existing SSH keys.
# Generating a new SSH key and adding it to the ssh-agent
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat /home/school/.ssh/id_rsa.pub
# copy the key and add your new SSH key to your GitHub account visit: https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account
# Checking for existing SSH keys
ls -al ~/.ssh
# Now you see a file name "id_rsa.pub" into a list that means you Ubuntu now have existing SSH key.
# Testing your SSH connection
ssh -T git@github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment