How to add a new SSH key to your GitHub account
there could be scenario when you change your username on github account and you are not able to clone any of your exiting repositiory into your local machine either you will face .
Fatal: Could not read from remote repository Please make sure you have the correct access rights and the repository exists
or error could be differnt like git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.in that case you have to generate new SSH key on your local machine and need to add same key into your github account .
prerequisite :- Download Git Bash from the below link based on your operating system and install it on your local system.
https://git-scm.com/downloads
step 1 open cmd / Git bash
step 2 use this command to generate SSH key on your local system
ssh-keygen -t rsa -b 4096 -C "youremail@gmail.com"
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
step 3 file will be generate on c/Users/you/.ssh/id_rsa this location
setp 4 SSH key open file from above location open file with notepad and copy content
of SSH key
step 5 Go to github account inside Setting => SSH key and GPG key =>SSH key Add new
Comments
Post a Comment