Skip to content

Instantly share code, notes, and snippets.

@rakibulinux
Last active August 26, 2022 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rakibulinux/994728ae73fe40db0630fddccb41d937 to your computer and use it in GitHub Desktop.
Save rakibulinux/994728ae73fe40db0630fddccb41d937 to your computer and use it in GitHub Desktop.
Generating a new SSH key and adding it to the ssh-agent
#!/bin/sh
# Install latest Git & Git Configure
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git
sudo -i
sudo git config --global user.name "Rakib Linux"
sudo git config --global user.email rakibulinux@gmail.com
ssh-keygen -t rsa -b 4096 -C "rakibulinux@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat /root/.ssh/id_rsa.pub
# copy and add ssh key to Github
ssh -T git@github.com
ssh -T git@gitlab.com
ssh -T git@bitbucket.org
git --version
git config --list
#How can I remove an entry in global configuration with git config?
git config --global --edit
#You can use the --unset flag of git config to do this like so:
git config --global --unset user.name
git config --global --unset user.email
#If you have more variables for one config you can use:
git config --global --unset-all user.name
#You can watch this video: https://youtu.be/2JVha4r7wpE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment