5

New to Git.

Followed all the directions from github help pages but simple commands like git pull and git push continues to prompt my password on each invocation. Specifically, I set the following:

  • git config --global user.name "Your name"
  • git config --global user.email [email protected]
  • git config --global github.token 123321321sdssddaqqwq

I also setup ssh keys elaborately as per the steps mentioned in the help but password prompts don't go away.

Suggestions?

1
  • 1
    What is the actual prompt? It may actually be a prompt for your passphrase on your SSH key. Commented Sep 8, 2011 at 18:55

3 Answers 3

9

From your comment saying that the password that works at this prompt is your GitHub password, I strongly suspect that you've cloned your repository using the https URL rather than the SSH URL. You can change that with:

 git remote set-url origin [email protected]:whoever/whatever.git

... where you should replace the last parameter with whatever's shown when you click the "SSH" button on your repository's page.

(You can check what URL origin currently refers to with git remote -v.)

Sign up to request clarification or add additional context in comments.

1 Comment

No problem. I thought this was a pretty good catch, though, and not a single up-vote from anyone? :)
0

Did you sign your pub key with a password? If you sign your key with a password, you'll always be prompted for that key. If you want no password, re-generate your .pub file without a password and upload that to github. If anyone gets access to your machine, they can commit as you, of course.

1 Comment

I regenerated the key without a passphrase and password prompt is still being asked. Note that the password I use to get past this is my github password.
0

You have to start ssh-agent, then use ssh-add to add your key. This requires the password once per session. You can also add it to the end of /etc/bashrc to add the key automatically on startup.

Better yet, have a simple function to your key to ssh-agent:

eval `ssh-agent`;
trap "kill $SSH_AGENT_PID" 0;
add-key {
  ssh-add;
}

2 Comments

I use windows. Why are these instructions not in the original github manual? What's the procedure to use github token as auth credentials?
This works on windows, given you use msysgit or a cygwin install. Don't ask me about github, I don't use it. What is a github token? You are only prompted for your password if you set up your key with one. I don't know if github assumes passwordless ssh keys …

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.