Git add ssh key to push
change git from https to ssh
- git remote rm origin
- git remote add origin git@github.com:yourname/demo.git
- git push origin
then generate a ssh key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
and then push code if it show that you don’t have permisson,
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
then add ssh key for git
ssh-add ~/.ssh/id_rsa