For more info visit GitHub docs
open git bash and type :
ls -al ~/.ssh
if you see these:
id_rsa.pub
id_ecdsa.pub
id_ed25519.pub
then you have the keys all you have to do is to link the key.
else if you don't
then you need to generate a new key
in git bash type :
ssh-keygen -t ed25519 -C "your_email@example.com"
if you are using a legacy system use:(if you dont know just use the one above)
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
this will create a new SSH key with the email attached but it will ask you some things, just keep pressing enter or you can do otherwise
in git bash type :
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
1.using the website:
copy the ssh key using in git bash :
clip < ~/.ssh/id_ed25519.pub
Go to your github page
In the upper-right corner of any page, click your profile photo, then click Settings > Acess
New SSH key or Add SSH key
In the title, you can add a description like, macbook key, or windows key and in the key `paste` what you copied using CTRL + V
then click add SSH key
then input your password to confirm2.using the (cli tool) git-bash visit the GitHub Docs(Adding a new SSH key to your GitHub account using the cli tool) for more detailed info and instructions
in git bash type :
ssh -T git@github.com
you will see a this
> The authenticity of host 'github.com (IP ADDRESS)' can't be established.
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
> Are you sure you want to continue connecting (yes/no)?
Verify that the fingerprint in the message you see matches GitHub's public key fingerprint. If it does, then type yes
the you will see this
> Hi username! You've successfully authenticated, but GitHub does not
> provide shell access.
where username
is your username