ls -a -l ~/.ssh
If id_rsa
and id_rsa.pub
are present, that means SSH keys are already present. If not then only add new SSH Keys.
ssh keygen -t rsa -b 4096 -C "{email-id}@gmail.com"
Press Enter every time.
cat ~/.ssh/id_rsa.pub
Copy selected text and add it to GitHub. Follow these steps:
- Click Profile Icon
- Select Settings
- Select SSH and GPG Keys
- Click New SSH key
- Add Title and Copy all the contents of
cat
command - Submit Add SSH Key
ssh -T [email protected]
cd {my-git-repository}
eval $(ssh-agent -s)
Note: Make Sure that the SSH Keys are already created.
ssh-add ~/.ssh/id_rsa
git remote add origin https://github.com/{username}/{my-git-repository}.git
ssh -T [email protected]
Then type yes to confirm.
git push -u origin master