5

I have read some questions around but still didn't found the solution to this problem

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

If I open a git-bash and try to ssh github I am able to connect, so this works

ssh -T [email protected] Hi username! You've successfully authenticated, but GitHub does not provide shell access. 

this means that git-bash actually sees my keys. However if I try to do a push

git push origin master 

git prompts me for username and password
Thank you for your help

EDIT: solved by using the git protocol instead of the http protocol, my fault
so replace this

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

whit this

[email protected]:_user_/_repository_.git 

in the remote link

2
  • Did you set it up with PUTTY? Do you have pagent running? Commented Jun 14, 2012 at 2:56
  • Close, but possibly inexact, duplicate: stackoverflow.com/questions/10962222/…. Commented Jun 14, 2012 at 4:09

2 Answers 2

5

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

git remote set-url origin [email protected]:username/repo.git 
Sign up to request clarification or add additional context in comments.

Comments

2

You probably cloned a remote that uses the https protocol, rather than the git protocol. You need to redefine your remote for origin.

# Change this as needed. github_username="$LOGNAME" # Replace your remote, then push. git remote rm origin git remote add origin "[email protected]:${github_username}/${PWD##*/}.git" git push --tags --set-upstream origin master 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.