To add key in Gitbash Make sure to use to enable ssh agent first.
[enter image description here][1] Now you can add ssh key in git bash using below command.
if you are doing it in windows Git Bash.
How to check if the key is added.
you should see the ssh key added here .
Below are the steps:
Open Git Bash and run below command on command prompt to generate public-private key pair ssh-keygen -t rsa -b 4096 -C "[email protected]"
When you are prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
Enter a file in which to save the key (/c/Users/username/.ssh/id_rsa):[Press enter]
At the prompt, type a secure passphrase. You can press enter if you want to leave it blank but its not recommended.
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
Go to /c/Users/username/.ssh/
folder and open id_rsa.pub
file and copy entire contents of it.
Finally, go to Github -> Settings -> SSH And GPG keys -> Click New RSA (Green Button
). Give some meaningful title to the key and paste the public key copied in step 4 above. Now click on Add SSH Key button.
Congrats, you have added public key to github successfully and now you can use gitbash to access github repositories.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With