Saturday, June 6, 2015

"git push" to Github wants me to log in!

If git prompts you for a username when you push:

$ git push

Username: 

Check your remote settings.

$ git remote -v
origin https://github.com/YOURNAME/notebook.git (fetch)
origin https://github.com/YOURNAME/notebook.git (push)

If it's an https reference, you can change it to an ssh reference as follows. 

$ git remote set-url origin git@github.com:YOURNAME/notebook.git

And everything is great!

$ git push
Everything up-to-date

No comments: