Git connect using ssh on windows

I read a few questions but could not find a solution to this problem

I have git on windows and I want to connect to github using ssh. Following this guide https://help.github.com/articles/generating-ssh-keys I have successfully installed my keys

If I open git - bash and try ssh github, I can connect, so this works

ssh -T git@github.com Hi username! You've successfully authenticated, but GitHub does not provide shell access. 

that means git - bash really sees my keys. However, if I try to push

 git push origin master 

git asks for username and password
Thank you for your help.

EDIT: solved using git protocol instead of http protocol, my mistake
so replace it

 https://github.com/_user_/_repository_.git 

whit this

 git@github.com :_user_/_repository_.git 

in remote link

+4
source share
2 answers

You probably cloned a remote server that uses the https protocol, not the git protocol. You need to redefine your remote for the source.

 # Change this as needed. github_username="$LOGNAME" # Replace your remote, then push. git remote rm origin git remote add origin " git@github.com :${github_username}/${PWD##*/}.git" git push --tags --set-upstream origin master 
+2
source

No need to remove / add, just do something like this:

 git remote set-url origin git@github.com :username/repo.git 
+5
source

All Articles